Printing Working Directory (PWD) in Linux

Printing Working Directory (PWD) in Linux

In order to discover where you are currently located within the filesystem, the pwd command can be used. The pwd command prints the working directory, your current location within the filesystem:

pwd [OPTIONS]

The output of the above command indicates that the user is currently in their home folder, shown in the filesystem below.

Notice above employ a prompt that displays the current working directory, emphasized with the color blue. In the first prompt above, the blue ~ is equivalent to /home/sysadmin, representing the user’s home directory.

After changing directories, the new location can also be confirmed in the new prompt, again shown in blue.

Leave a Reply
Your email address will not be published. *

This site uses Akismet to reduce spam. Learn how your comment data is processed.