pushd

pushd (built-in Bash command)

The manual page and help for the pushd built-in Bash command. The pushd command adds a directory to the directory stack. It puts a directory on top of the directory stack or rotates the stack, making the current working directory the new top item. Called without arguments, swaps the top two directories and returns 0 unless the directory stack is empty. The directory stack can be displayed with the dirs command and the popd command can be used to extract a directory from it. The current directory is always the first directory in the stack.