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