PWD(1) General Commands Manual PWD(1)

pwdreturn working directory name

pwd

The pwd utility shall write an absolute pathname of the current working directory to standard output.

None.

None.

None.

None.

The following environment variables shall affect the execution of pwd:

This variable shall determine the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (beginning with LC_ ) do not specify a locale. See 2.6.

This variable shall determine the locale to be used to override any values for locale categories specified by the settings of LANG or any environment variables beginning with LC_.

This variable shall determine the language in which messages should be written.

Default.

The pwd utility output shall be an absolute pathname of the current working directory: "%s\n", <directory pathname>

Used only for diagnostic messages.

None.

None.

The pwd utility shall exit with one of the following values:

Successful completion.

An error occurred.

If an error is detected, output shall not be written to standard output, a diagnostic message shall be written to standard error, and the exit status shall not be zero.

Some implementations have historically provided pwd as a shell special built-in command.

In most utilities, if an error occurs, partial output may be written to standard output. This does not happen in historical implementations of pwd. Because pwd is frequently used in existing shell scripts without checking the exit status, it is important that the historical behavior is required here; therefore, the Consequences of Errors subclause specifically disallows any partial output being written to standard output.

September 1991 posix.fail