精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > linux常見命令cd

      linux常見命令cd

      時間: 佳洲1085 分享

      linux常見命令cd

        linux下cd命令是一個常見的基礎(chǔ)命令語句,下面由學(xué)習(xí)啦小編為大家整理了linux常見命令cd命令的相關(guān)知識,希望大家喜歡!

        linux常見命令cd命令詳解

        1. 命令格式:

        cd [目錄名]

        2. 命令功能:

        切換當(dāng)前目錄至dirName

        linux常見命令cd命令的常用范例

        例一:進(jìn)入系統(tǒng)根目錄

        命令:

        cd /

        輸出:

        [root@localhost ~]# cd /

        說明:進(jìn)入系統(tǒng)根目錄,上面命令執(zhí)行完后拿ls命令看一下,當(dāng)前目錄已經(jīng)到系統(tǒng)根目錄了

        命令:

        cd .. 或者 cd .. //

        輸出:

        1 [root@localhost soft]# pwd

        2 /opt/soft

        3 [root@localhost soft]# cd ..

        4 [root@localhost opt]# cd ..//

        5 [root@localhost /]# pwd

        6 /

        說明:

        進(jìn)入系統(tǒng)根目錄可以使用“ cd .. ”一直退,就可以到達(dá)根目錄

        命令:

        cd ../.. //

        輸出:

        1 [root@localhost soft]# pwd

        2 /opt/soft

        3 [root@localhost soft]# cd ../.. //

        4 [root@localhost /]# pwd

        5 /

        6 [root@localhost /]#

        說明:使用cd 命令實現(xiàn)進(jìn)入當(dāng)前目錄的父目錄的父目錄。

        例2:使用 cd 命令進(jìn)入當(dāng)前用戶主目錄

        “當(dāng)前用戶主目錄”和“系統(tǒng)根目錄”是兩個不同的概念。進(jìn)入當(dāng)前用戶主目錄有兩個方法。

        命令1:

        cd

        輸出:

        1 [root@localhost soft]# pwd

        2 /opt/soft

        3 [root@localhost soft]# cd

        4 [root@localhost ~]# pwd

        5 /root

        命令2:

        cd ~

        輸出:

        1   [root@localhost ~]# cd /opt/soft/

        2   [root@localhost soft]# pwd

        3   /opt/soft

        4   [root@localhost soft]# cd ~

        5   [root@localhost ~]# pwd

        6   /root

        例3:跳轉(zhuǎn)到指定目錄

        命令:

        cd /opt/soft

        輸出:

        1 [root@localhost ~]# cd /opt/soft

        2 [root@localhost soft]# pwd

        3 /opt/soft

        4 [root@localhost soft]# cd jdk1.6.0_16/

        5 [root@localhost jdk1.6.0_16]# pwd

        6 /opt/soft/jdk1.6.0_16

        7 [root@localhost jdk1.6.0_16]#

        說明:

        跳轉(zhuǎn)到指定目錄,從根目錄開始,目錄名稱前加 / ,當(dāng)前目錄內(nèi)的子目錄直接寫名稱即可

        例四:返回進(jìn)入此目錄之前所在的目錄

        命令:

        cd -

        輸出:

        1 [root@localhost soft]# pwd

        2 /opt/soft

        3 [root@localhost soft]# cd -

        4 /root

        5 [root@localhost ~]# pwd

        6 /root

        7 [root@localhost ~]# cd -

        8 /opt/soft

        9 [root@localhost soft]#

        例五:把上個命令的參數(shù)作為cd參數(shù)使用。

        命令:

        cd !$

        輸出:

        1 [root@localhost soft]# cd !$

        2 cd -

        3 /root

        4 [root@localhost ~]# cd !$

        5 cd -

        6 /opt/soft

        7 [root@localhost soft]#

      3612421