pwd Command


Displays the path name of the working directory.


pwd [ -L | -P ]


The pwd command writes to standard output the full path name of your current directory (from the root directory). All directories are separated by a / (slash). The root directory is represented by the first /, and the last directory named is your current directory.


Displays the value of the PWD environment variable if the PWD environment variable contains an absolute path name of the current directory that does not contain the file names . (dot) or .. (dot-dot). Otherwise, the -L flag behaves the same as the -P flag.
Displays the absolute path name of the current directory. The absolute path name displayed with the -P flag does not contain file names that, in the context of the path name, refer to files of type symbolic link.

Exit Status

This command returns the following exit values:

Item Description
0 Successful completion.
>0 An error occurred.




displays the current directory as:



Item Description
/usr/bin/pwd Contains the pwd command.