Last login: Mon 28 Sep 2026 on tty1
Archived edition.
Ten things the page says. Every one of them is on your machine right now — run the command above and check.
Print the full filename of the current working directory.[man]
use PWD from environment, even if it contains symlinks.[man]
NOTE: your shell may have its own version of pwd, which usually supersedes the version described here.[man]
Please refer to your shell's documentation for details about the options it supports.[man]
pwd prints the name of the current directory.[info]
If the contents of the environment variable 'PWD' provide an absolute name of the current directory with no '.' or '..' components, but possibly with symbolic links, then output those contents.[info]
Print a fully resolved name for the current directory.[info]
That is, all components of the printed name will be actual directory names - none will be symbolic links.[info]
If -L and -P are both given, the last one takes precedence.[info]
If neither option is given, then this implementation uses -P as the default unless the 'POSIXLY_CORRECT' environment variable is set.[info]
Find out where you actually are
There are two right answers to 'where am I' when symlinks are involved, and pwd -P is the one the kernel agrees with.
These commands write files, so run them in a scratch directory:
$ mkdir -p ~/motd-lab && cd ~/motd-lab
$ pwd
$ ln -sfn . here
$ cd here
$ pwd
$ pwd -P
WHAT YOU SHOULD SEEAfter stepping through the symlink, pwd shows the path with 'here' in it and pwd -P shows the real resolved path underneath.
Five questions, each one taking a term out of a line above. Ten points for each. Tap hear it to have a question read to you; answering plays the verdict.
QUESTION 1 OF 5
Which term completes this line from the page? “Print the full filename of the current working _____.”
From point 1 above.
QUESTION 2 OF 5
Which term completes this line from the page? “NOTE: your shell may have its own version of pwd, which usually _____ the version described here.”
From point 3 above.
QUESTION 3 OF 5
Which term completes this line from the page? “pwd _____ the name of the current directory.”
From point 5 above.
QUESTION 4 OF 5
Which term completes this line from the page? “Print a fully _____ name for the current directory.”
From point 7 above.
QUESTION 5 OF 5
Which term completes this line from the page? “If -L and -P are both given, the last one takes _____.”
From point 9 above.
Answer all five to bank your points.
Five chapters, three voices. Tap one to jump — the player at the bottom of the screen follows.
Know someone with ten minutes and a terminal? Send them today's page. This is the card that appears when you post it:
The Operator has a dispatch on pwd(1),
and he files them for subscribers only. It is free.
Join the club, or read about
the series.
MOTD is a weekday reading of one manual page already installed on your own
machine. Every statement is quoted from that page or from the GNU info
documentation beside it, and every edition names the command that shows you
the source.
archive ·
the operator ·
about ·
podcast ·
Feline Union