PushCD
Format: PUSHCD [
]
Template: DIR
Purpose: Change and remember the current directory
Path: Internal
Specification: PUSHCD places the current working directory onto the
directory stack and, optionally, changes the current directory to
the specified target.
PUSHCD works very much like the CD command except that it remembers the
current directory before it gets changes. This remembered directory can be
retrieved later on by means of either POPCD or SWAPCD.
The shell maintains a so-called "directory stack" onto which PUSHCD stacks
the directories; each "PUSHCD" enlarges this stack by one entry, adding it
to the top of the stack. A "POPCD" command removes the top entry from this
stack and makes it the current directory; it therefore retrieves the former
stored directory.
Examples:
Assume that the current directory is "SYS:" and you change into "Tools"
by means of PUSHCD:
1.SYS:> pushcd Tools
afterwards, the current directory will be "SYS:Tools", and the top entry
on the directory stack will be "SYS:";
1.SYS:Tools>
A subsequent POPCD will restore the former directory.
1.SYS:Tools> popcd
will result in the SYS: directory as current directory again.
1.SYS:>
See also: POPCD, SWAPCD