- pushd and popd
-
In computing,
pushd
andpopd
are commands in various Unix, DOS and Microsoft Windows command line interpreters (shells) such as Bash,cmd.exe
, 4DOS/4NT and Windows PowerShell. Both commands are used to work with the command line directory stack.The
pushd
command saves the current working directory in memory so it can be returned to at any time, optionally changing to a new directory. Thepopd
command returns to the path at the top of the directory stack.In the Windows PowerShell, pushd is a predefined command alias for the
Push-Location
Cmdlet and popd is a predefined command alias for thePop-Location
Cmdlet. Both serve basically the same purpose as the Unix-likepushd
andpopd
commands.Contents
Syntax
pushd
pushd [path | ..]
Arguments:
path
This optional command-line argument specifies the directory to make the current directory. Ifpath
is omitted, the path at the top of the directory stack is used.
popd
popd
Examples
Unix
[/usr/ports]$ pushd /etc /etc /usr/ports [/etc]$ popd /usr/ports [/usr/ports]$
MS DOS
C:\Users\root>pushd \ C:\>popd C:\Users\root>
See also
- List of DOS commands
- List of Unix programs
References
- Microsoft TechNet Pushd article
- Microsoft TechNet Popd article
- Bash Reference Manual: Directory Stack Builtins
Unix command-line interface programs and shell builtins (more) File system Processes User environment Text processing Shell builtins Networking Searching Documentation Miscellaneous Windows command line programs and built-ins (more) File system
(basic)File system
(advanced)Processes Registry User environment Text processing Shell programming Networking Searching Miscellaneous Categories:- MS-DOS/Windows Command Prompt commands
- DOS on IBM PC compatibles
- Microcomputer software
- Windows administration
- Computing commands
- Unix stubs
- Microsoft Windows stubs
Wikimedia Foundation. 2010.