pwd

Print the full absolute path of the current working directory.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

pwd resolves and prints the absolute path. -P shows the physical path resolving symlinks, useful after cd-ing through symlinked directories. The $PWD variable is always available as an alternative.

Common flags
FlagMeaning
-P --physicalPrint real physical path, resolving all symlinks
-L --logicalUse shell logical path including symlinks (default)
Examples
pwdShow current directory · explain & risk-check →
pwd -PShow real path resolving any symlinks · explain & risk-check →
SCRIPT_DIR=$(pwd)Capture current directory into a variable in a script · explain & risk-check →
Pro tip

In bash scripts use `$PWD` built-in variable instead of calling `$(pwd)` — it's faster since it avoids spawning a subshell.

Related
cd ls dirs
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man pwd for your version. Test destructive commands on a non-production system first.