variable
Bash PWD — current working directory
Tracks the working directory as maintained by Bash, including logical path behavior. cd updates it on success.
Formal Syntax & Structure
bash syntaxbash
$PWDReturn Value
string
Current working directory pathname.
Working Example
Example Snippetbash
printf 'home=%s\n' "$HOME"cd /printf 'pwd=%s\n' "$PWD"