Glossary

pwd

pwd ("print working directory") outputs the absolute path of the shell's current directory. It is a shell builtin, though /bin/pwd also exists for scripting outside a shell.

pwd                      # /home/alice/projects
pwd -P                   # resolve symlinks, print physical path
pwd -L                   # print logical path (default)

The shell variable $PWD holds the same value and is slightly faster to reference in scripts. $OLDPWD holds the previous directory, letting cd - toggle between the two.

Related terms: cd, ls, Shell

Discussed in:

Linux Simulator: learn Linux on iPhone. Download on the App Store.