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.

794 B

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 ~