This article is about the management of the current directory in Bash.
You can query the current working directory via:
echo $PWD
shell variable concerning the current directory
working directory
pwd stands for “print working directory”.
echo $PWD
Old working directory (“OLD-Print-Working-Directory”, previous directory you were in).
cd must have be used once.
echo $OLDPWD
You can set it via the:
echo ~+ # ie PWD
echo ~- # ie OLDPWD