Linux命令详解 -- cd
2015-07-23 17:18
806 查看
cd [-L|-P] [dir]
Change the current directory to dir. The variable HOME is the default dir. The variable CDPATH defines the search path for the directory containing dir. Alternative directory names in CDPATH are separated by a colon (:). A null directory name in CDPATH is the same as the current directory, i.e., ‘‘.’’. If dir begins with a slash (/), then CDPATH is not used. The -P option says to use the physical directory structure instead of following symbolic links (see also the -P option to the set builtin command); the -L option forces symbolic links to be followed. An argument of - is equivalent to $OLDPWD. If a non-empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. The return value is true if the directory was successfully changed; false otherwise.
HOME: 默认登录主目录 echo $HOME
CDPATH:用来方便切换常用目录,例如:export CDPATH=.:~:/etc:/var。永久保存: vim ~./bash_profile
OLDPWD:存储上一次目录切换的位置。
cd : 用户主目录,与$HOME 同义。
cd ~: 用户主目录,与$HOME 同义。
cd -P : physical 直接切换物理目录。
cd -L : link、logic 切换到符号连接的目录,并不指向物理目录。
cd - : 与$OLDPWD同义, 指向上一次的目录。
cd . : 当前所在目录
cd .. : 当前目录的上级目录
Change the current directory to dir. The variable HOME is the default dir. The variable CDPATH defines the search path for the directory containing dir. Alternative directory names in CDPATH are separated by a colon (:). A null directory name in CDPATH is the same as the current directory, i.e., ‘‘.’’. If dir begins with a slash (/), then CDPATH is not used. The -P option says to use the physical directory structure instead of following symbolic links (see also the -P option to the set builtin command); the -L option forces symbolic links to be followed. An argument of - is equivalent to $OLDPWD. If a non-empty directory name from CDPATH is used, or if - is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. The return value is true if the directory was successfully changed; false otherwise.
HOME: 默认登录主目录 echo $HOME
CDPATH:用来方便切换常用目录,例如:export CDPATH=.:~:/etc:/var。永久保存: vim ~./bash_profile
OLDPWD:存储上一次目录切换的位置。
cd : 用户主目录,与$HOME 同义。
cd ~: 用户主目录,与$HOME 同义。
cd -P : physical 直接切换物理目录。
cd -L : link、logic 切换到符号连接的目录,并不指向物理目录。
cd - : 与$OLDPWD同义, 指向上一次的目录。
cd . : 当前所在目录
cd .. : 当前目录的上级目录
相关文章推荐
- 电脑硬件分析Ultimate Boot CD v4.1.1 下载
- 批处理命令详解之目录跳转:cd
- cd命令 目录跳转
- CSMA/CD媒体访问控制
- 2015-03-13 第三课 ls,cd,alias,PATH,目录结构,快捷键
- linux cd技巧
- 每天一个linux命令(2):cd命令
- Shell出现cd命令无法识别
- 初学Java时,如何在CMD中快速进入编译目录目录
- Linux常用文本处理命令
- 每天一个linux命令(2):cd命令
- Linux之目录处理命令
- linux目录太长怎么办?分享一点小技巧
- rhel cd镜像 制作 dvd
- 如何把FLAC+CUE刻录成CD
- linux下的几个cd命令
- Matlab使用cd切换路径后无法保留addpath添加的路径解决方案
- linux cd命令详解及cd命令的几个小技巧
- cd命令
- cd命令