linux shell pushd popd dirs命令
来源:互联网 发布:华为路由器配置端口ip 编辑:程序博客网 时间:2024/05/19 14:40
linux shell pushd popd dirs命令
1、dirs
1)功能
显示当前目录栈中的所有记录(不带参数的dirs命令显示当前目录栈中的记录)
2)语法
(1)格式:dirs [-clpv] [+n] [-n]
(2)选项
-c 删除目录栈中的所有记录
-l 以完整格式显示
-p 一个目录一行的方式显示
-v 每行一个目录来显示目录栈的内容,每个目录前加上的编号
+N 显示从左到右的第n个目录,数字从0开始
-N 显示从右到左的第n个日录,数字从0开始
注意:dirs始终显示当然目录, 再是堆栈中的内容;即使目录堆栈为空, dirs命令仍然只显示当然目录
2、pushd
1)功能
pushd命令常用于将目录加入到栈中,加入记录到目录栈顶部,并切换到该目录;若pushd命令不加任何参数,则会将位于记录栈最上面的2个目录对换位置
2)语法
(1)格式:pushd [目录 | -N | +N] [-n]
(2)选项
目录 将该目录加入到栈顶,并执行"cd 目录",切换到该目录
+N 将第N个目录移至栈顶(从左边数起,数字从0开始)
-N 将第N个目录移至栈顶(从右边数起,数字从0开始)
-n 将目录入栈时,不切换目录
------------------------------------------------------------------------------------------
pushd
Save and then change the current directory. With no arguments, pushd
exchanges the top two directories.
SYNTAX pushd [dir | +N | -N] [-n]KEY +N Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -N Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -n Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. dir Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir'. cds to dir.
3、popd
1)功能
popd用于删除目录栈中的记录;如果popd命令不加任何参数,则会先删除目录栈最上面的记录,然后切换到删除过后的目录栈中的最上面的目录
2)语法
(1)格式:popd [-N | +N] [-n]
(2)选项
+N 将第N个目录删除(从左边数起,数字从0开始)
-N 将第N个目录删除(从右边数起,数字从0开始)
-n 将目录出栈时,不切换目录
-------------------------------------------------------------------------------------------
popd
Remove the top entry from the directory stack, and cd
to the new top directory.
SYNTAX popd [+N | -N] [-n]Key +N Remove the Nth directory (counting from the left of the list printed by dirs), starting with zero. -N Remove the Nth directory (counting from the right of the list printed by dirs), starting with zero. -n Suppress the normal change of directory when removing directories from the stack, so that only the stack is manipulated.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory.
The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0.
参考:http://hi.baidu.com/linuxtrip/item/47a38c8eec00e98f4414cfb7
转自:https://www.cnblogs.com/davidwang456/p/3784102.html
- linux shell pushd popd dirs命令
- linux shell pushd popd dirs命令
- linux shell pushd popd dirs命令
- linux中的pushd命令及栈原理 [shell] pushd,popd,dirs,cd -
- pushd,popd及dirs命令
- dirs\pushd\popd命令用法
- dirs\pushd\popd命令用法
- dirs\pushd\popd命令用法
- linux 命令之 pushd、popd、dirs,以及栈的基础知识
- Linux中pushd、popd和dirs
- dirs、pushd、popd指令
- pushd popd dirs
- linux命令cd pushd popd
- Linux命令--pushd和popd
- 【Bash百宝箱】shell目录栈(dirs、pushd、popd)
- 使用pushd、popd和dirs来重定义cd命令
- Linux 切换目录更方便: pushd,popd,dirs,cd
- linux 命令 pushd popd cd 区别
- 学习Python爬虫的几个问题
- HDU1014 POJ1597 UVALive5492 UVA408 ZOJ1314 Uniform Generator【随机函数+水题】
- 【第七届蓝桥杯】卡片换位
- Python条件、循环和其他语句
- 好用的GIT,可选中文
- linux shell pushd popd dirs命令
- Volley源码解析
- day 21 Linux软件包安装与卸载
- 深度:车联网制造商该从物联网“老司机”那里吸取哪些教训
- 想成为数据科学家?你得先读读这篇文章
- 解决linux QT不能切换中文输入法
- C语言——求解数独(深搜)
- Win10下VS2015(WDK10)驱动开发环境配置
- 没听清楚出处的题