🐧 Linux pwd Command
Print the absolute path name of the current working directory.
Syntax
$ pwd [options]
Common Command Options
| Option | Description |
|---|---|
-L | Print the value of $PWD if it names the current working directory (logical path, default) |
-P | Print the physical directory, without any symbolic links resolved (canonical true path) |
--help | Display help message and exit |
--version | Output version information and exit |
Practical Examples
Print Current Working Directory
pwd
Outputs the full path from root / to your active terminal folder.
Resolve True Physical Path (Ignore Symlinks)
pwd -P
Resolves symbolic link shortcuts into the actual underlying physical filesystem path.
Store Working Path in Variable
MY_PATH=$(pwd)
Stores the current directory path into a bash script variable for automated tasks.