pwd – Linux Command to Print Working Directory
pwd is a Linux / Unix command which prints the current working directory. If you wish to know the full path of theĀ directory in which you are in from the Linux console, then the pwd command will come to your rescue. pwd stands for Print Working Directory.
If you check the man page of pwd in Linux, you won\’t find any options for it. But in reality, pwd does have one option called -P, which lists the current working directory with all the links resolved.
Usage of pwd command
I have a directory called \”Examples/\” on my machine which is actually a soft link to the directory /usr/share/example-content/. If you are using Ubuntu Linux, you will also have this directory on your machine in your Home folder.
I move into the \”Examples/\” directory and run the pwd command to get the following output.
$ cd Examples $ pwd /home/laf/Examples
Now if I pass the option -P with pwd, it will list the physical current working directory with all the links resolved.
$ pwd -P /usr/share/example-content
