Basics

Linux pwd command

Print the full path of your current working directory.

Availability: Common Linux commands; shell built-ins and external implementations may differ by distribution.中文

Syntax

pwd [-L | -P]

Examples

Print the current working directory.

pwd

Print the physical path after resolving symbolic links.

pwd -P

Parameters, options and clauses

Option / clauseDescription
-LShow the logical path, including symbolic links (default).
-PResolve symbolic links and show the physical path.
--helpDisplay help (GNU Bash/Coreutils variants).
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory