built-in Bash commands
popd (built-in Bash command)
The manual page and help for the popd built-in Bash command. The popd command removes a directory from the directory stack. Without arguments, it removes the top-level directory from the directory stack and sets the new working directory to the extracted item. If the popd command is successful, a dirs command is also executed and returns 0. The directory stack can be displayed with the dirs command, and a new directory can be added with the pushd command.
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.
dirs (built-in Bash command)
The manual page and help for the dirs built-in Bash command. Use the dirs command to display the directory stack. Displays a list of currently memorized directories without options. The default output of the command returns memorized directory names separated by spaces in a single line. Directories that you want to remember can be put on the stack with the pushd command and removed with the popd command. The current directory is always the first directory on the stack.