1, dirs
1) Function
displays all records in the current directory stack (the dirs command with no parameters displays the records in the current directory stack)
2) Syntax
(1) format: dirs [-CLPV] [+n] [-n]
(2) Options
-C Delete all records in the directory stack
- l display in full format
-p A directory row of the way display
- v each row is a directory to display the contents of the directory stack, plus the number in front of each directory
+n Displays the nth directory from left to right, with numbers starting from 0
-N Displays the nth Daily Record from right to left, with numbers starting from 0
Note: dirs always displays the directory of course, and then the contents of the stack, even if the directory stack is empty, the dirs command still displays only the course directory
2, pushd
1) Function
The pushd command is often used to add directories to the stack, add records to the top of the directory stack, and switch to the directory, and if the pushd command does not add any parameters, the 2 directories on the top of the record stack will be swapped for location
2) Syntax
(1) format: pushd [Directory |-n | +n] [-n]
(2) Options
the directory joins the directory to the top of the stack and executes the "CD directory" to switch to that directory
+n Move the nth directory to the top of the stack (number from the left, number starting from 0)
-N Moves the nth directory to the top of the stack (number from the right, number starting from 0)
-N does not switch directories when the directory is in the stack
3, popd
1) Function
popd is used to delete records from the directory stack, and if the popd command does not add any parameters, the topmost record of the directory stack is deleted and then the topmost directory in the deleted directory stack is switched to
2) Syntax
(1) format: popd [-n | +n] [-n]
(2) Options
+n Delete Nth directories (number from left, number starting from 0)
-N Deletes the nth directory (starting from the right, the number starts with 0)
-N does not switch directories when the directory is out of the stack
Reference: Http://hi.baidu.com/linuxtrip/item/47a38c8eec00e98f4414cfb7