🐧 Linux pwd Command

Print the absolute path name of the current working directory.

Syntax

$ pwd [options]

Common Command Options

Option Description
-LPrint the value of $PWD if it names the current working directory (logical path, default)
-PPrint the physical directory, without any symbolic links resolved (canonical true path)
--helpDisplay help message and exit
--versionOutput 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.