In a Linux hierarchy, users can use the mkdir command to create a new directory under any authorized directory, or they can use the CD command to convert from one directory to another. However, there is no prompt to tell the user which directory is currently in. To know the current directory, you can use the PWD command, which displays the entire path name.
Name
Print Working Directory
Use
Displays the path name of the working directory.
Grammar
PWD [-l |-p]
Describe
The PWD command writes the full path name (from the root directory) of the current directory to standard output. All directories are separated by/(slash). The first/represents the root directory, and the last directory is the current directory.
Sign
-L
If the PWD environment variable contains a filename that is not included. (point) or.. The absolute pathname of the current directory (point), the value of the PWD environment variable is displayed. Otherwise, the-l flag runs like the-P flag.
-P
Displays the absolute path name of the current directory. The absolute path displayed with the-p flag does not contain the name of the file that involves the symbolic link type in the absolute path of the path name.
Exit status
This command returns the following export values:
0 completed successfully.
"0 error occurred.