Online Linux Terminal Logo
OnlineLinuxTerminal
NavigationCLI Reference

$pwd

Print the absolute path of the current working directory.

Syntax DefinitionPOSIX standard
pwd [OPTIONS]
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `pwd` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How pwd Works

`pwd` stands for "Print Working Directory". It outputs the full, absolute path starting from the root directory (`/`) to the folder you are currently located in. It is critical for writing scripts and verifying current context before executing destructive commands like `rm`.

Common Flags & Command Options

Flag / OptionDescription
-LPrint logical working directory (resolving symbolic links according to shell).
-PPrint physical working directory with all symbolic links completely resolved.

Practical Real-World Examples

Example #1Print current directory path

Outputs the absolute filesystem path.

Sample Output:
/home/user

Frequently Asked Questions

What is the difference between logical and physical paths in pwd?

If you enter a symlinked folder, `pwd -L` displays the symlink path you followed, whereas `pwd -P` reveals the true physical underlying directory on disk.