linux shell pushd popd dirs命令
1、dirs1)功能显示当前目录栈中的所有记录(不带参数的dirs命令显示当前目录栈中的记录)2)语法(1)格式:dirs? [-clpv]? [+n]? [-n](2)选项-c ?? 删除目录栈中的所有记录-l???? 以完整格式显示-p??? 一个目录一行的方式显示-v??? 每行一个目录来显示目录栈的内容,每个目录前加上的编号+N? 显示从左到右的第n个目录,数字从0开始-N?? 显示从右到左的第n个日录,数字从0开始注意:dirs始终显示当然目录,再是堆栈中的内容;即使目录堆栈为空,dirs命令仍然只显示当然目录2、pushd1)功能pushd命令常用于将目录加入到栈中,加入记录到目录栈顶部,并切换到该目录;若pushd命令不加任何参数,则会将位于记录栈最上面的2个目录对换位置2)语法(1)格式:pushd? [目录 | -N | +N]?? [-n](2)选项目录?? 将该目录加入到栈顶,并执行"cd 目录",切换到该目录+N?? 将第N个目录移至栈顶(从左边数起,数字从0开始)-N??? 将第N个目录移至栈顶(从右边数起,数字从0开始)-n??? 将目录入栈时,不切换目录 ------------------------------------------------------------------------------------------ pushdSave and then change the current directory. With no arguments,? 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. 3、popd1)功能popd用于删除目录栈中的记录;如果popd命令不加任何参数,则会先删除目录栈最上面的记录,然后切换到删除过后的目录栈中的最上面的目录2)语法(1)格式:popd? [-N | +N]?? [-n](2)选项+N?? 将第N个目录删除(从左边数起,数字从0开始)-N??? 将第N个目录删除(从右边数起,数字从0开始)-n??? 将目录出栈时,不切换目录 ?------------------------------------------------------------------------------------------- popdRemove the top entry from the directory stack,and? SYNTAX popd [+N | -N] [-n] 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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |