Table of Contents

Bash - popd (Builtin command)

About

popd removes entries from the directory stack. See dirs.

Syntax

With no arguments, removes the top directory from the stack, and performs a cd to the new top directory.

popd [-n] [+n] [-n]

where:

Return value

If the popd command is successful, a dirs is performed as well, and the return status is 0.

popd returns false if:

Example

Go away and returns

# we are now in /
pushd /aDir/
# we are now in /aDir/
popd
# we are now back in the starting current directory /