For those working with Linux command Line, command ‘pwd‘ is very helpful, which tells where you are – in which directory, starting from the root (/). Specially for Linux newbies, who may get lost amidst of directories in command Line Interface while navigation, command ‘pwd‘ comes to rescue.
What is pwd?
‘pwd‘ stands for ‘Print Working Directory‘. As the name states, command ‘pwd‘ prints the current working directory or simply the directory user is, at present. It prints the current directory name with the complete path starting from root (/). This command is built in shell command and is available on most of the shell – bash, Bourne shell, ksh,zsh, etc.
Basic syntax of pwd:
Options used with pwd
Options | Description |
-L (logical) | Use PWD from environment, even if it contains symbolic links |
-P (physical) | Avoid all symbolic links |
–help | Display this help and exit |
–version | Output version information and exit |
If both ‘-L‘ and ‘-P‘ options are used, option ‘L‘ is taken into priority. If no option is specified at the prompt, pwd will avoid all symlinks, i.e., take option ‘-P‘ into account.
Exit status of command pwd:
0 | Success |
Non-zero |
This article aims at providing you a deep insight of Linux command ‘pwd‘ with practical examples.
1. Print your current working directory.
No comments:
Post a Comment