pwd
where am Ipwd prints the working directory: the one place every relative path is measured from. It is the smallest command in the shell and the first one to run when a script or a copy lands somewhere you did not expect.
Every relative path is relative to this directory — so know it before you type one.
At the terminal
Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.
What the numbered lines are telling you
The leading slash is the top of the filesystem. Read left to right, each name is a directory inside the one before it.
The shell reports the names you travelled through. "current" is a symbolic link, and pwd shows it as you typed it.
With the link resolved, the real directory is a dated release folder. The two answers differ only when a symlink is in the path.
Switches
A switch changes how the command behaves. These are the ones used day to day; man pwd lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.
-L- Logical: print the path as you walked it, symbolic links included. This is the default.
-P- Physical: resolve every symbolic link and print where you really are on disk.
Variations worth knowing
The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.
echo $PWDThe same answer from the shell variable — the form to use inside scripts.
pwd -PResolves every symbolic link and prints the physical directory.
cd "$(dirname "$0")" && pwdInside a script: move to the script's own folder and confirm it, so relative paths behave.
echo $OLDPWDThe directory you were in before the last cd.
In cybersecurity
A command does what it does wherever the shell happens to be. Most accidents with destructive commands are a correct command run in the wrong directory.
Run pwd before any rm or mv that uses a relative path or a wildcard. It costs one second.
A logical path can hide that you are really inside another filesystem or another user's tree. -P shows the truth.
A scheduled job does not start where you tested it. Set the directory explicitly rather than assuming it.