Pwd
pwd (print working directory) is a shell command that reports the working directory path to standard output.[src] 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.[src] The command is part of the X/Open Portability Guide since issue 2 of 1987.[src] It was inherited into the first version of POSIX.1 and the Single Unix Specification.[src] It appeared in Version 5 Unix.[src] The version bundled in GNU Core Utilities was written by Jim Meyering.[src] The command is available in other shells and operating systems including SpartaDOS X, PANOS, and KolibriOS.[src] PowerShell provides as an alias for the cmdlet Get-Location .[src] An equivalent command in COMMAND.COM and Command Prompt is the cd command with no arguments.[src] On Windows CE 5.0, cmd.exe includes a pwd command.[src] The OpenVMS equivalent is show default .[src] The numerical computing environments MATLAB and GNU Octave include a pwd function with similar functionality.[src] The command is implemented as a shell builtin in many Unix shells including sh, ash, bash, ksh, and zsh.[src] It can be implemented with the POSIX getcwd() or getwd() functions.[src]
pwd (print working directory) is a shell command that reports the working directory path to standard output.[src] 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.[src] The command is part of the X/Open Portability Guide since issue 2 of 1987.[src] It was inherited into the first version of POSIX.1 and the Single Unix Specification.[src] It appeared in Version 5 Unix.[src] The version bundled in GNU Core Utilities was written by Jim Meyering.[src] The command is available in other shells and operating systems including SpartaDOS X, PANOS, and KolibriOS.[src] PowerShell provides as an alias for the cmdlet Get-Location .[src] An equivalent command in COMMAND.COM and Command Prompt is the cd command with no arguments.[src] On Windows CE 5.0, cmd.exe includes a pwd command.[src] The OpenVMS equivalent is show default .[src] The numerical computing environments MATLAB and GNU Octave include a pwd function with similar functionality.[src] The command is implemented as a shell builtin in many Unix shells including sh, ash, bash, ksh, and zsh.[src] It can be implemented with the POSIX getcwd() or getwd() functions.[src] ==Examples== The following examples are based on a typical Unix-based implementation.[src] With no arguments, the command writes the working directory path to the terminal: $ cd /home/example $ pwd /home/example Display the working directory without any symbolic link info.[src] If at a directory /home/symlinked that is a symlink to /home/realdir: $ cd /home/symlinked $ pwd -P /home/realdir Display the working directory with symbolic link info.[src] Note: POSIX requires that the default behavior be as if the -L switch were provided.[src] $ pwd -L /home/symlinked ==Shell variables== POSIX shells set the following environment variables while using the command: OLDPWD : The previous working directory PWD : The current working directory ==See also== Breadcrumb (navigation), an alternative way of displaying the work directory List of POSIX commands pushd and popd ==References== ==Further reading== ==External links==[src]
33 sentences · 33 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Pwd." encyclopegia.org, 2026, https://encyclopegia.org/wiki/pwd. Accessed 27 November 2026.
Chicago
"Pwd." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/pwd.
APA
encyclopegia.org. (2026). Pwd. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/pwd
Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON