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
$PWD

Return Value

string

Current working directory pathname.

Working Example

Example Snippetbash
printf 'home=%s\n' "$HOME"cd /printf 'pwd=%s\n' "$PWD"
Bash Reference