popd

popd [ {+|-}n ]

Remove an entry from the directory stack, and perform a cd to the new top directory. With no argument, the current top entry is removed.

Option Description

+n

Identifies a stack entry by counting from the left of the list shown by the dirs command, starting with zero.

-n

Counts from the right.

If the PUSHD_MINUS option is set, the meanings of + and - in this context are swapped.