pushd and popd
||This article includes a list of references, related reading or external links, but its sources remain unclear because it lacks inline citations. (March 2010)|
popd 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.
pushd command saves the current working directory in memory so it can be returned to at any time, optionally changing to a new directory. The
popd command returns to the path at the top of the directory stack. This directory stack is accessed by the command
dirs in Unix or
Get-Location -stack in Windows PowerShell.
In the Windows PowerShell, pushd is a predefined command alias for the
Push-Location cmdlet and popd is a predefined command alias for the
Pop-Location cmdlet. Both serve basically the same purpose as the Unix-like
The commands were first used by William Sturka in 1976.
pushd [path | ..]
pathThis optional command-line argument specifies the directory to make the current directory. If
pathis omitted, the path at the top of the directory stack is used. This has the effect of toggling between two directories.
[/usr/ports]$ pushd /etc /etc /usr/ports [/etc]$ popd /usr/ports [/usr/ports]$
C:\Users\root>pushd \ C:\>popd C:\Users\root>
- Microsoft TechNet Pushd article
- Microsoft TechNet Popd article
- Bash Reference Manual: Directory Stack Builtins
|This Unix-related article is a stub. You can help Wikipedia by expanding it.|
|This Microsoft Windows article is a stub. You can help Wikipedia by expanding it.|