FreeDOS help system (hhstndrd 1.0.8 en)[pushd]

Command: pushd

PUSHD pushes current directory onto the directory stack, with the option to change current working directory.

Syntax:

PUSHD [[drive]path] [/?] [[drive]path] is a path to which you wish to change.

Options:

/? Shows the help.

Comments:

PUSHD is a lot like CD, except that it stores the current directory before changing it. Later on, POPD can be used to restore it. PUSHD can be used several times, storing a stack of directories. Using PUSHD without specifying a directory will store the current directory, but not change it. PUSHD is a command internal to command.com and needs no other file in order to work.

Examples:

this command changes the current directory to / shows: ============ =========================================cd c:\fdos\bin c:\fdos\bin pushd c:\games c:\games (and stores c:\fdos\bin) pushd c:\utils c:\utils (and stores c:\games) pushd c:\packages c:\packages (and stores c:\utils) dirs shows the directories stored by pushd: 0001=c:\fdos\bin 0002=c:\games 0003=c:\utils popd c:\utils (and removes c:\utils (0003) from directory stack) popd c:\games (and removes c:\games (0002) from directory stack) popd c:\fdos\bin (and removes c:\fdos\bin (0001) from directory stack) popd shows the message: "Directory stack empty"

See also:

cd chdir dirs popd ------------------------------------------------------------------------------ Copyright (C) 2003 Robert Platt, updated 2007 and 2020 by W. Spiegl. This file is derived from the FreeDOS Spec Command HOWTO. See the file H2Cpying for copying conditions.