命令参数
cd:
usage: cd [-L|-P] [dir]
-L 链接目录
-P 实际目录
dir 要去的目录
cd 到home目录
[root@guofeng ~]# cd /usr/local/nginx-1.6.2
[root@guofeng nginx-1.6.2]# pwd
/usr/local/nginx-1.6.2
[root@guofeng nginx-1.6.2]# cd
[root@guofeng ~]#
cd / 到根目录
[root@guofeng ~]# cd /
[root@guofeng /]# cd
[root@guofeng ~]# cd ..
[root@guofeng /]# pwd
/
[root@guofeng /]# cd /usr/local/nginx-1.6.2
[root@guofeng nginx-1.6.2]# cd /
[root@guofeng /]#
cd .. 返回上一级目录
[root@guofeng nginx-1.6.2]# pwd
/usr/local/nginx-1.6.2
[root@guofeng nginx-1.6.2]# cd ..
[root@guofenglocal]# pwd
/usr/local
[root@guofenglocal]# cd ../../
[root@guofeng /]# pwd
/
[root@guofeng /]# cd /usr/local/
[root@guofenglocal]# pwd
/usr/local
[root@guofenglocal]#
cd -L -P 到链接的文件 或者到实际目录
[root@guofeng/]# cd usr/
[root@guofeng usr]# ll
total 132
dr-xr-xr-x. 2 root root 36864 May 2319:26 bin
drwxr-xr-x. 2 root root 4096 Sep 232011 etc
drwxr-xr-x. 2 root root 4096 Sep 232011 games
drwxr-xr-x. 35 root root 4096 May 2204:49 include
dr-xr-xr-x. 27 root root 4096 Nov 72014 lib
dr-xr-xr-x. 86 root root 36864 May 2319:26 lib64
drwxr-xr-x. 22 root root 12288 Nov 82014 libexec
drwxr-xr-x. 22 root root 4096 May 2423:16 local
dr-xr-xr-x. 2 root root 12288 May 2319:26 sbin
drwxr-xr-x. 175 root root 4096 Nov 72014 share
drwxr-xr-x. 4 root root 4096 Nov 82014 src
lrwxrwxrwx. 1 root root 10 Nov 82014 tmp -> ../var/tmp
[root@guofeng usr]# cd -L tmp/
[root@guofeng tmp]# ll
total 0
[root@guofeng tmp]# cd ..
[root@guofeng usr]# cd -P tmp/
[root@guofeng tmp]# cd ..
[root@guofengvar]# pwd
/var
[root@guofengvar]#
cd - 返回进入此目录之前所在的目录
[root@guofeng /]# cd /usr/
[root@guofeng usr]# cd local/
[root@guofenglocal]# cd apache-tomcat/
[root@guofeng apache-tomcat]# ll
total 8
drwxr-xr-x. 3 root root 4096 Nov 72014 apache-tomcat1
drwxr-xr-x. 3 root root 4096 Nov 72014 apache-tomcat2
[root@guofeng apache-tomcat]# cd -
/usr/local
[root@guofenglocal]#
1, cd 全名(change directory) 改变目录 linux 使用最多命令命令参数cd: usage: cd [-L|-P] [dir] -L 链接目录 -P 实际目录 dir 要去的目录cd 到home目录[root@guofeng ~]# cd /usr/local/nginx-1.6.2[root@guofeng nginx-1.6.