pushd [-n] [dir | +N | -N]
Add directories to the directory stack.
Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working directory. With no arguments, exchanges the top two directories.
Arguments:
dir- Adds DIR to the directory stack at the top, making it the new current working directory.+N- Rotates the stack so that the Nth directory (counting from the left of the list shown bydirs', starting with zero) is at the top. --N- Rotates the stack so that the Nth directory (counting from the right of the list shown bydirs', starting with zero) is at the top.
Options:
-n- Suppresses the normal change of directory when adding directories to the stack, so only the stack is manipulated.
You can see the directory stack with the dirs command.
Exit Status: Returns success unless an invalid argument is supplied or the directory change fails.
Reference: https://www.gnu.org/software/bash/manual/html_node/Directory-Stack-Builtins.html