In computing, pushd and 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.
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. The popd 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 the Pop-Location Cmdlet. Both serve basically the same purpose as the Unix-like pushd and popd commands.
Syntax
pushd
pushd [path | ..]
Arguments:
path This optional command-line argument specifies the directory to make the current directory. If path is omitted, the path at the top of the directory stack is used.
popd
popd
Example
C:\Users\root>pushd C:\
C:\>popd
C:\Users\root>
See also
References
|
Unix command line programs and builtins (more) |
|
| File system |
|
|
| Processes |
|
|
| User environment |
|
|
| Text processing |
|
|
| Shell programming |
|
|
| Networking |
|
|
| Searching |
|
|
| Miscellaneous |
|
|
|
Windows command line programs and builtins (more) |
|
File system
(basic) |
|
|
File system
(advanced) |
|
|
| Processes |
|
|
| User environment |
|
|
| Text processing |
|
|
| Shell programming |
|
|
| Networking |
|
|
| Searching |
|
|
| Miscellaneous |
|
|
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)