builtin
Bash pwd — print working directory
Prints the current working directory. -L may preserve symbolic-link path components; -P requests a physical pathname. Useful for locating scripts and files. Output depends on your environment.
Formal Syntax & Structure
bash syntaxbash
pwd [-LP]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -L | option | Use logical directory path. |
| -P | option | Print physical directory path. |
Return Value
exit status
0 on success; nonzero on failure.
Working Example
Example Snippetbash
pwd