PWD 8474
   HOME

TheInfoList



OR:

In Unix-like and some other operating systems, the pwd command (''print working directory'') writes the full pathname of the current working directory to the standard output.


Implementations

Multics had a pwd command (which was a short name of the print_wdir command) from which the Unix pwd command originated. The command is a shell builtin in most Unix shells such as
Bourne shell The Bourne shell (sh) is a Shell (computing), shell Command-line interface#Command-line interpreter, command-line interpreter for computer operating systems. The Bourne shell was the default Unix shell, shell for Version 7 Unix. Unix-like syste ...
, ash, bash, ksh, and zsh. It can be implemented easily with the POSIX C functions getcwd() or getwd(). It is also available in the operating systems
SpartaDOS X SpartaDOS X (or SpartaDOS 4.0) is a disk operating system for the Atari 8-bit family of computers that closely resembles MS-DOS. It was developed and sold by ICD, Inc. in 1987-1993, and many years later picked up by the third-party community S ...
, PANOS, and KolibriOS. The equivalent on DOS ( COMMAND.COM) and
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
( cmd.exe) is the cd command with no arguments. Windows PowerShell provides the equivalent Get-Location cmdlet with the standard aliases gl and pwd. On
Windows CE 5.0 Windows CE 5.0 (codenamed "Macallan") is a successor to Windows CE 4.2, the third release in the Windows CE .NET family. It was first released on July 9, 2004. Like its predecessors, Windows CE 5.0 is marketed towards the embedded device marke ...
, the cmd.exe ''Command Processor Shell'' includes the pwd command. as found on Unix systems 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 of pwd bundled in GNU coreutils was written by Jim Meyering. The numerical computing environments MATLAB and GNU Octave include a pwd function with similar functionality. The
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Ope ...
equivalent is show default.


*nix examples

Note: POSIX requires that the default behavior be as if the -L switch were provided.


Working directory shell variables

POSIX shells set the following environment variables while using the cd command: ; OLDPWD : The previous working directory (as set by the cd command). ; PWD : The current working directory (as set by the cd command).


See also

* Breadcrumb (navigation), an alternative way of displaying the work directory *
List of GNU Core Utilities commands This is a list of commands from the GNU Core Utilities for Unix environments. These commands can be found on Unix operating systems and most Unix-like operating systems. List See also * List of Unix commands * List of GNOME applications * L ...
* List of Unix commands * pushd and popd


References


Further reading

*


External links

* * * * * * * * {{Core Utilities commands Multics commands Unix SUS2008 utilities Plan 9 commands Inferno (operating system) commands IBM i Qshell commands File system directories