pushd

Save the value of the current directory.

Syntax
      pushd [-n] [dir]
pushd [-n] [+N] [-N] Key +N Rotate the stack so that the nth directory (counting from the left of the list shown
by dirs, starting with zero) is at the top.
-N Rotate the stack so that the nth directory (counting from the right of the list shown
by dirs, starting with zero) is at the top. -n Suppresses the normal change of directory when adding directories to the stack, so that
only the stack is manipulated.
dir Add dir to the directory stack at the top, making it the new current working directory.

If the pushd command is successful, a dirs is performed as well. If the first form is used, pushd returns 0 unless the cd to dir fails. With the second form, pushd returns 0 unless the directory stack is empty, a non-existent directory stack element is specified, or the directory change to the specified new current directory fails.

This is a BASH shell builtin, to display your local syntax from the bash prompt type: help pushd

"Fear is the greatest salesman" ~ Robert Klein

Related macOS commands:

popd - Restore the previous directory


 
Copyright © SS64.com 1999-2019
Some rights reserved