BASH Manual section 6.8: The Directory Stack dirs -v # print stack, one per line, indexed from left pushd # swap top 2 entries, and cd to new top entry pushd {dir} # add {dir} to top of stack, and cd to it pushd +N # swap Nth entry with current top, and cd to it popd # delete current top of stack, and cd to new top popd +N # remove Nth index entry popd -n # manipulate stack only; don't change directory