cd
cd – Change the current directory to dir.
改变当前的工作目录。
语法
cd [-L|-P] [dir]
[选项]
-L : 若指定的目录为软链接则切换至软链接目录。
-P : 若指定的目录为软链接则切换至原目录。
[参数]
要切换到的目录。
[实例]
[root@z-dig ~]# ll -d src scripts lrwxrwxrwx 1 root root 3 Jul 22 15:51 scripts -> src drwxr-xr-x 2 root root 4096 Jul 13 22:12 src [root@z-dig ~]# [root@z-dig ~]# cd scripts [root@z-dig scripts]# pwd /root/scripts [root@z-dig scripts]#
[root@z-dig ~]# cd -L scripts [root@z-dig scripts]# pwd /root/scripts [root@z-dig scripts]#
[root@z-dig ~]# cd -P scripts [root@z-dig src]# pwd /root/src [root@z-dig src]#
正文部分到此结束