PWD Great Lakes Water Main Installation (14058449987)
   HOME

TheInfoList



OR:

In
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
and some other
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
s, the pwd
command Command may refer to: Computing * Command (computing), a statement in a computer language * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on Apple Macintosh computer keyboards * ...
(''print working directory'') writes the full
pathname A path is a string of characters used to uniquely identify a location in a directory structure. It is composed by following the directory tree hierarchy in which components, separated by a delimiting character, represent each directory. The del ...
of the current
working directory In computing, the working directory of a process is a directory of a hierarchical file system, if any, dynamically associated with each process. It is sometimes called the current working directory (CWD), e.g. the BSD getcwd function, or just c ...
to the
standard output In computer programming, standard streams are interconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdin ...
.


Implementations

Multics Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing operating system based on the concept of a single-level memory.Dennis M. Ritchie, "The Evolution of the Unix Time-sharing System", Communications of ...
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 computing, a shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute. Shell builtins work significantly fa ...
in most
Unix shell A Unix shell is a command-line interpreter or shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating syste ...
s such as Bourne shell,
ash Ash or ashes are the solid remnants of fires. Specifically, ''ash'' refers to all non-aqueous, non- gaseous residues that remain after something burns. In analytical chemistry, to analyse the mineral and metal content of chemical samples, ash ...
,
bash Bash or BASH may refer to: Arts and entertainment * ''Bash!'' (Rockapella album), 1992 * ''Bash!'' (Dave Bailey album), 1961 * '' Bash: Latter-Day Plays'', a dramatic triptych * ''BASH!'' (role-playing game), a 2005 superhero game * "Bash" ('' ...
, ksh, and
zsh The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell (computing), shell and as a command line interpreter, command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including som ...
. It can be implemented easily with the
POSIX The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming inter ...
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 KolibriOS, or Kolibri, is a small, open-source x86 operating system written completely in assembly. It was forked from MenuetOS in 2004 and has run under independent development since. In a 2009 review piece on alternative operating systems, ...
. The equivalent on
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
(
COMMAND.COM COMMAND.COM is the default command-line interpreter for MS-DOS, Windows 95, Windows 98 and Windows Me. In the case of DOS, it is the default user interface as well. It has an additional role as the usual first program run after boot (init proc ...
) and Microsoft Windows (
cmd.exe Command Prompt, also known as cmd.exe or cmd, is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows (Windows NT family and Windows CE family), and ReactOS operating systems. On Windows CE .NET 4.2, Windo ...
) is the cd command with no arguments.
Windows PowerShell PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-so ...
provides the equivalent Get-Location
cmdlet PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-sou ...
with the standard aliases gl and pwd. On Windows CE 5.0, the cmd.exe ''Command Processor Shell'' includes the pwd command. as found on Unix systems is part of the
X/Open X/Open group (also known as the Open Group for Unix Systems and incorporated in 1987 as X/Open Company, Ltd.) was a consortium founded by several European UNIX systems manufacturers in 1984 to identify and promote open standards in the field of info ...
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 term "Research Unix" refers to early versions of the Unix operating system for DEC PDP-7, PDP-11, VAX and Interdata 7/32 and 8/32 computers, developed in the Bell Labs Computing Sciences Research Center (CSRC). History The term ''Resear ...
. The version of pwd bundled in
GNU GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
coreutils The GNU Core Utilities or coreutils is a package of GNU software containing implementations for many of the basic tools, such as cat, ls, and rm, which are used on Unix-like operating systems. In September 2002, the ''GNU coreutils'' were cr ...
was written by Jim Meyering. The numerical computing environments
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementa ...
and
GNU Octave GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a langu ...
include a pwd function with similar functionality. The OpenVMS 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 variable An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP envi ...
s 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) A breadcrumb or breadcrumb trail is a graphical control element used as a navigational aid in user interfaces and on web pages. It allows users to keep track and maintain awareness of their locations within programs, documents, or websites. The ...
, an alternative way of displaying the work directory * List of GNU Core Utilities commands *
List of Unix commands This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems. List See also * List of G ...
* 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