Command form:
pushd [dir | +n |-n] [-n]
1. The pushd command without parameters will exchange two directories at the top of the directory stack, equivalent to using the cd– command.
2. The stack bottom of the directory stack holds the working directory when the pushd command is executed when the directory stack is empty.
3, the function of the parameter N is to iterate the directory stack, the nth entry loop in the directory stack is moved to the top of the stack, the entry of the top of the stack will be the current working directory (+ represents the number from the top of the stack, the top of the stack is represented as +0;-from the bottom of the stack, and the bottom is represented as
4. The-n option is to disallow directory switching operations when the directory is in the stack to the directory stack, thus allowing only the directory to be stacked onto the directory stack.
5. The Pushd-n dir command indicates that the DIR directory is placed in the stack to the next location on top of the directory stack stack. Dir can be a directory that does not exist.
6, Pushd-n +n | The-n command indicates that the current working directory is replaced with the top directory after the loop has moved through the directory stack.
pushd of directory switching under Linux