| PWD(1) | User Commands | PWD(1) |
pwd — return
working directory name
/usr/bin/pwd |
[-L | -P] |
The pwd utility writes an absolute path
name of the current working directory to standard output.
The Bourne shell, sh(1), the
Korn shells, ksh(1) and
ksh93(1), and most other shells have a
built-in pwd command. If just
pwd is used while in shell context and not an
absolute path to a command, the shell's built-in version will be
executed.
When no options are specified, pwd
operates as though -P was specified. Systems vary in
the defaults they use here and many historical defaults diverge from POSIX.
For portable operation, always specify -L or
-P.
pwd supports the following options:
-LPWD environment
variable will be used as long as it appears valid. Criteria may include
whether this is an absolute or relative path, if there are any path
component's that are ‘.’. or ‘..’, and if the
actual path refers to the expected file system location.
The -L option overrides any prior
instances of the -P option.
-P-P option overrides any prior instances of the
-L option.PWD-L option is specified.In addition, see environ(7)
for descriptions of the following environment variables that affect the
execution of pwd: LANG,
LC_ALL, LC_MESSAGES, and
NLSPATH.
The following exit values are returned:
If an error is detected, output will not be written to standard output, a diagnostic message will be written to standard error, and the exit status will not be 0.
“Cannot open ..” and “Read error in ..” indicate possible file system trouble and should be referred to a UNIX system administrator.
cd(1), ksh(1), ksh93(1), sh(1), shell_builtins(1), attributes(7), environ(7), standards(7)
If you move the current directory or one above it,
pwd may not give the correct response. Use the
cd(1) command with a full path name to
correct this situation.
| March 31, 2026 | OmniOS |