pwd Command: Tutorial & Examples
Print the current working directory
The pwd
command is a Linux utility that stands for "print working directory." It is used to display the full path of the current working directory (also known as the "current
directory") in the file system.
When you open a terminal window and start working on the command line, you are placed in a specific directory, which is known as your current working directory. You can navigate to
different directories and perform various file management tasks using commands such as cd
, ls
, and mkdir
.
The pwd
command allows you to see the full path of the current working directory at any time.
To use the pwd
command, simply type pwd
and press Enter. The full path of the current working directory will be displayed on the command line.
Here's an example of using the pwd
command:
pwd
/home/user/documents
In this example, the output shows that the current working directory is /home/user/documents
.
The pwd
command is a simple but useful tool that is available on most Linux distributions. It can be helpful when you want to see the location of the current working directory or
when you want to reference a file or directory using its full path.