Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

pwd - return working directory name

&pagelevel(4)&pagelevel

The POSIX shell built-in pwd writes the absolute path name of the working (current) directory on the standard output.


Syntax


pwd

If the error message

Cannot open ...

or

Read error in ...

is displayed, a file system error has occurred. Inform the POSIX administrator.

Locale

The following environment variables affect the execution of pwd:

LANG

Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL

If set to a non-empty string value, override the values of all the other internationalization variables.

LC_MESSAGES

Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

NLSPATH

Determine the location of message catalogs for the processing of LC_MESSAGES.

Example

You want to define your current directory as the home directory:

$ pwd

/usr/art/cobol/prg

$ HOME=pwd`
$ echo $HOME

/usr/art/cobol/prg

See also

cd