Pushd and popd

In computing, codice_1 and codice_2 are commands used to work with the command line directory stack. They are available on command-line interpreters such as 4DOS, Bash, C shell, tcsh, Hamilton C shell, KornShell, cmd.exe, and PowerShell for operating systems such as DOS, Microsoft Windows, ReactOS, and Unix-like systems.
Overview.
The codice_1 command saves the current working directory in memory so it can be returned to at any time, codice_1 moves to the parent directory. The codice_2 command returns to the path at the top of the directory stack. This directory stack is accessed by the command codice_6 in Unix or codice_7 in Windows PowerShell.
The first Unix shell to implement a directory stack was Bill Joy's C shell. The syntax for pushing and popping directories is essentially the same as that used now.
Both commands are available in FreeCOM, the command-line interface of FreeDOS.
In Windows PowerShell, "pushd" is a predefined command alias for the codice_8 cmdlet and "popd" is a predefined command alias for the codice_9 cmdlet. Both serve basically the same purpose as the codice_1 and codice_2 commands.
Syntax.
Pushd.
 pushd [path | ..]
Arguments:
Popd.
 popd
Examples.
Unix-like.
[user@server /usr/ports] $ pushd /etc
/etc /usr/ports
[user@server /etc] $ popd
/usr/ports
[user@server /usr/ports] $
Microsoft Windows and ReactOS.
C:\Users\root>pushd C:\Users
C:\Users>popd
C:\Users\root>
DOS batch file.
@echo off
rem This batch file deletes all .txt files in a specified directory
pushd %1
del *.txt
popd
echo All text files deleted in the %1 directory