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:
-L Output a logical path. The PWD 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 Print the physical path, resolves any symlinks encountered.
The -P option overrides any prior instances of the -L
option.
PWD The logical current working directory which is used
when the -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:
0 Successful completion.
>0 An error occurred.
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.
Committed
Enabled
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.
illumos March 31, 2026 illumos
NAME
pwd - return working directory name
SYNOPSIS
/usr/bin/pwd [-L | -P]
DESCRIPTION
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.
OPTIONS
pwd supports the following options:
-L Output a logical path. The PWD 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 Print the physical path, resolves any symlinks encountered.
The -P option overrides any prior instances of the -L
option.
ENVIRONMENT VARIABLES
PWD The logical current working directory which is used
when the -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.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
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.
DIAGNOSTICS
"Cannot open .." and "Read error in .." indicate possible file system
trouble and should be referred to a UNIX system administrator.
INTERFACE STABILITY
Committed
CODE SET INDEPENDENCE
Enabled
SEE ALSO
cd(1), ksh(1), ksh93(1), sh(1), shell_builtins(1), attributes(7),
environ(7), standards(7)
NOTES
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.
illumos March 31, 2026 illumos