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
linux shell pushd popd dirs命令的更多相关文章
- pushd&popd&dirs命令
dirs 显示当前目录栈中的所有记录 -p 一个目录一行显示 -l 以完整格式显示 -c 删除目录栈中的所有记录 -v 每行一个目录来显示,每个目录前加上编号 +N 从左到右的第n个 ...
- linux shell 中的sleep命令
开始还以为是这样的语法: sleep(1), 后面发现是: linux shell 中的sleep命令 分类: LINUX 在有的shell(比如linux中的bash)中sleep还支持睡眠(分,小 ...
- linux command pushd popd
Linux command pushd popd [Purpose] Learning linux command pushd popd [Eevironment] ...
- pushd,popd,dirs,cd -让切换目录更方便
与linux cd命令相似,用pushd实现在不同目录间切换 在命令行模式下,当你工作在不同目录中,你将发现你有很多时间都浪费在重复输入上如果这些目录不在同一个根目录中,你不得不在转换时输入完整的路径 ...
- Linux Shell Vim 经常使用命令、使用技巧总结
前言 本文总结了自己实际开发中的经常使用命令,不定时更新,方便自己和其它人查阅. 如有其它提高效率的使用技巧.欢迎留言. 本文地址 http://blog.csdn.net/never_cxb/art ...
- linux shell 学习笔记--内部命令学习
.基本命令 新手必须要掌握的初级命令 ls 基本的列出所有文件的命令.但是往往就是因为这个命令太简单,所以我们总是低估它.比如 ,用 -R 选项,这是递归选项,ls 将会以目录树的形式列出所有文件, ...
- 【程序员技术练级】熟悉Unix/Linux Shell和常见的命令行(一)文件系统结构和基本操作
作为程序猿,熟悉一些unix/linux命令行是非常必要的,因为部署服务的服务器现在基本上用的都是unix/linux系统,很少在windows上部署服务的. 今天我们就介绍一些在linux上的文件系 ...
- Linux Shell基础 Bash常见命令 echo命令
概述 shell中常见的命令echo. 输出命令:echo echo命令的输出内容如果没有特殊含义,则将原内容输出到屏幕:如果输出内容有特殊含义,则输出打印其含义. 命令格式如下: [root@loc ...
- Linux&shell之结构化命令
写在前面:案例.常用.归类.解释说明.(By Jim)使用if-then语句如果命令的退出状态是0(成功执行命令),将执行then后面的所有命令.如果命令的退出状态是0以外的其他值,那么then后面的 ...
随机推荐
- SCOI2015题解 && 考试小结
Day1: 第一题:裸地二分+网络流:二分答案,连接将每行每列拆成点,对于满足答案的格子行列连边,看是否流量是否大于t即可,可惜第k大看成了第k小,然后100分就没了. 第二题:倍增,考虑贪心算法,就 ...
- VCC,VDD,VEE,VSS,VPP 表示的意义
转自VCC,VDD,VEE,VSS,VPP 表示的意义 VCC,VDD,VEE,VSS,VPP 表示的意义 版本一: 简单说来,可以这样理解: 一.解释 VCC:C=circuit 表示电路的意思, ...
- Mono for Android 优势与劣势
原文:Mono for Android 优势与劣势 最近有兴趣了解一下Mono for Andriod,也就是使用.NET平台来开发Andriod程序.Mono for Android API 几乎映 ...
- android原生系统裁剪
Andriod 4.0.4系统包 Andriod 4.1.1系统包 说明 ApplicationsProvider.apk ApplicationsProvider.apk 应用程序存储. 程序管 ...
- 三星 PMU NXE2000,x-powers的AXP228,NXE2000
核心板PMIC X4418CV2并没有用三星推荐的PMU NXE2000,而是自主研发,采用x-powers的AXP228,这是因为AXP228更符合用户的习惯,更适合做产品,他们有如下区别: PMU ...
- poj3415
很久以前写的,忘补结题报告了两串相连中间用特殊的分隔符然后求height,由于要求求公共子串大于等于k的个数,并且只要位置不同即可因此不难想到在名次上对height分组,一组内的height保证> ...
- 动态规划(DP计数):HDU 5121 Just A Mistake
As we all know, Matt is an outstanding contestant in ACM-ICPC. Graph problems are his favorite.Once, ...
- linux时间设置相关
1.查询时间命令:date 2.设置日期:date -s mm/dd/yyyy 3.设置时间:date -s HH:MM:SS 4.将当前时间及日期写入BIOS,避免重启失效:hwclock -w 5 ...
- 【leetcode】编辑距离
dp方程“ 1.初始化:dp[0][i]=i; dp[j][0]=j; 2.dp[i][j]= dp[i-1][j-1](相等) dp[i-1][j]+1 ,,dp[i][j-1]+1 ...
- strcpy,memcpy,内存块重叠
前段时间准备面试,看了一些库函数的实现,在看到memcpy时,发现有处理source和destination所指内存有重叠的情况,而strcpy没有,特别模仿库函数写了这个函数,并进行了测试.以下是具 ...