You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
812 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

popd
===
用于删除目录栈中的记录
## 说明
**popd命令** 用于删除目录栈中的记录如果popd命令不加任何参数则会先删除目录栈最上面的记录然后切换到删除过后的目录栈中的最上面的目录。
### 语法
```
pushd(选项)(参数)
```
```
+N将第N个目录删除从左边数起数字从0开始
-N将第N个目录删除从右边数起数字从0开始
-n将目录出栈时不切换目录。
```
### 实例
```
root@Mylinux:/tmp/dir4# popd相当于popd +0
/tmp/dir3 /tmp/dir2 /tmp/dir1 ~
root@Mylinux:/tmp/dir3# pushd /tmp/dir4
/tmp/dir4 /tmp/dir3 /tmp/dir2 /tmp/dir1 ~
root@Mylinux:/tmp/dir4# popd +1
/tmp/dir4 /tmp/dir2 /tmp/dir1 ~
root@Mylinux:/tmp/dir4# popd -2
/tmp/dir4 /tmp/dir1 ~
```