Linux cd 命令是Linux中最基本的命令语句,其余的命令语句要进行操做,都是创建在使用 cd 命令上的。java
cd [目录名]spa
切换当前目录至dirNamecode
命令:cd / blog
[root@king ~]# cd /
说明:进入系统根目录,上面命令执行完后拿ls命令看一下,当前目录已经到系统根目录了 博客
命令:cd .. 或者 cd .. //class
1 [root@king soft]# pwd 2 /opt/soft 3 [root@king soft]# cd .. 4 [root@king opt]# cd .. 5 [root@king /]# pwd 6 /
说明:进入系统根目录能够使用“ cd .. ”一直退,就能够到达根目录 方法
“当前用户主目录”和“系统根目录”是两个不一样的概念。进入当前用户主目录有两个方法。im
命令1:cddi
命令2:cd ~co
命令: cd /opt/soft
1 [root@king ~]# cd /opt/soft 2 [root@king soft]# pwd 3 /opt/soft
说明:跳转到指定目录,从根目录开始,目录名称前加 / ,当前目录内的子目录直接写名称便可
命令:cd -
1 [root@king soft]# pwd 2 /opt/soft 3 [root@king soft]# cd - 4 /root 5 [root@king ~]# pwd 6 /root 7 [root@king ~]# cd - 8 /opt/soft 9 [root@king soft]#
命令:cd !$
1 [root@king soft]# cd !$ 2 cd - 3 /root 4 [root@king ~]# cd !$ 5 cd - 6 /opt/soft 7 [root@king soft]#
说明:相信你们看到这里都会感受很绕,!$就是至关于上一条命令的参数,不过博客感受这命令很弱鸡吧,