π 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.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 03:55 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format