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.
pushd is a bash builtin command.
"Fear is the greatest salesman" - Robert Klein
popd - Restore the previous directory
© Copyright SS64.com 1999-2013
Some rights reserved