commands

pwd — current working directory

In Bash, pwd normally prints the logical absolute current directory. -L uses a logical path where valid; -P requests physical path resolution without symbolic-link components. The GNU external utility has different default behavior, so do not assume identical defaults.

Formal Syntax & Structure

linux syntaxlinux
pwd [-L | -P]

Parameters & Attributes

NameTypeDescription
-LoptionLogical path.
-PoptionPhysical path.

Return Value

text and exit status

Directory path on stdout; zero on success, nonzero on failure.

Working Example

Example Snippetlinux
pwd
Linux Reference