π File: coreutils.info, Node: pwd invocation, Next: stty invocation, Up: Working context
| Use Case | Command | Description |
|---|---|---|
| Print current directory | pwd | Prints the working directory |
| Show logical path (with symlinks) | pwd -L | Use PWD environment variable if valid |
| Show physical path (no symlinks) | pwd -P | Resolve all symbolic links |
pwd [OPTION]...
π pwd prints the name of the current directory. The program accepts the following options. Also see Common options.
-L, --logical: π If the contents of the environment variable PWD provide an absolute name of the current directory with no . or .. components, but possibly with symbolic links, then output those contents. Otherwise, fall back to default -P handling.-P, --physical: π Print a fully resolved name for the current directory. That is, all components of the printed name will be actual directory namesβnone will be symbolic links.βοΈ If -L and -P are both given, the last one takes precedence. If neither option is given, then this implementation uses -P as the default unless the POSIXLY_CORRECT environment variable is set.
β οΈ Due to shell aliases and built-in pwd functions, using an unadorned pwd interactively or in a script may get you different functionality than that described here. Invoke it via env (i.e., env pwd ...) to avoid interference from the shell.
β
An exit status of 0 indicates success, and a non-zero value indicates failure.
Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-10 22:26 @2600:1f28:365:80b0:2634:f534:c836:dc5e
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)