Skip to content
EntityQ305928· pop 27· linked from 227 articles

pwd (print working directory) is a shell command that reports the working directory path to standard output.

In the Vinony graph

Within Vinony's link graph, pwd is referenced by 227 other articles, and connects out to GNU General Public License, list of UNIX commands and Bell Labs.

It is catalogued under topics including File system directories, IBM i Qshell commands and Inferno (operating system) commands.

Its subject is documented across 27 Wikipedia language editions.

Key facts

Software.name
pwd
Software.screenshot
Pwdkommando.png
Software.caption
The pwd command
Software.author
AT&T Bell Laboratories
Software.developer
Various open-source and commercial developers
Software.programming language
C
Software.operating system
Multics, Unix, Unix-like, V, Plan 9, Inferno, SpartaDOS X, PANOS, Windows CE, KolibriOS
Software.platform
Cross-platform
Software.genre
Command
Software.license
coreutils: GPLv3+Plan 9: MIT License

via Wikipedia infobox

Described at

The pwd utility shall write to standard output an absolute pathname of the current working directory, which does not contain the filenames dot or dot-dot. If the PWD environment variable contains an absolute pathname of the current directory and the pathname does not contain any components that are dot or dot-dot, pwd shall write this pathname to standard output, except that if the PWD environment variable is longer than {PATH MAX} bytes including the terminating null, it is unspecified whether pwd writes this pathname to standard output or behaves as if the -P option had been specified. Otherwise, the -L option shall behave as the -P option. The pathname written to standard output shall not contain any components that refer to files of type symbolic link. If there are multiple pathnames that the pwd utility could write to standard output, one beginning with a single character and one or more beginning with two characters, then it shall write the pathname beginning with a single character. The pathname shall not contain any unnecessary characters after the leading one or two characters. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( 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 historical shell scripts without checking the exit status, it is important that the historical behavior is required here; therefore, the CONSEQUENCES OF ERRORS section specifically disallows any partial output being written to standard output. An earlier version of this standard stated that the PWD environment variable was affected when the -P option was in effect. This was incorrect; conforming implementations do not do this. Changes to the pwd utility and PWD environment variable have been made to match the changes to the getcwd () function made for Austin Group Interpretation 1003.1-2001 140.

Excerpt from a page describing this subject · 7,744 chars · not written by Vinony

Wikidata facts

Image
Pwdkommando.png
Show 3 more facts
Stack Exchange tag
stackoverflow.com/tags/pwd
has command line option
P
Sources (3)

via Wikidata · CC0

~2 min read

Encyclopedic overview

6 sections
Contents
  • Examples
  • Shell variables
  • See also
  • References
  • Further reading
  • External links

pwd (print working directory) is a shell command that reports the working directory path to standard output.

Although often associated with Unix, its predecessor Multics had a pwd command (which was a short name of the print_wdir command) from which the Unix command originated. The command is part of the X/Open Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX.1 and the Single Unix Specification. It appeared in Version 5 Unix. The version bundled in GNU Core Utilities was written by Jim Meyering.

Excerpted from Wikipedia’s “pwd” article, available under the CC BY-SA 4.0 licence.

Categories