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
794 B

7 years ago
popd
===
用于删除目录栈中的记录
6 years ago
## 说明
7 years ago
5 years ago
**popd命令** 用于删除目录栈中的记录如果popd命令不加任何参数则会先删除目录栈最上面的记录然后切换到删除过后的目录栈中的最上面的目录
7 years ago
5 years ago
## 选项
7 years ago
```
pushd(选项)(参数)
```
6 years ago
7 years ago
```
5 years ago
+N将第N个目录删除从左边数起数字从0开始
-N将第N个目录删除从右边数起数字从0开始
-n将目录出栈时不切换目录
7 years ago
```
5 years ago
## 实例
7 years ago
```
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 ~
```