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

  • <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系統(tǒng)中查看當(dāng)前路徑的命令

      Linux系統(tǒng)中查看當(dāng)前路徑的命令

      時間: 佳洲1085 分享

      Linux系統(tǒng)中查看當(dāng)前路徑的命令

        Linux系統(tǒng)中我們編程的時候經(jīng)常會遇到當(dāng)前路徑問題,要怎么知道呢?下面由學(xué)習(xí)啦小編為大家整理了Linux系統(tǒng)中查看當(dāng)前路徑的命令詳解,希望對大家有幫助!

        Linux系統(tǒng)中查看當(dāng)前路徑的命令:pwd命令詳解

        1.命令格式 :

        pwd [選項]

        2.命令功能:

        查看”當(dāng)前工作目錄“的完 整路徑

        3.常用參數(shù):

        一般情況下不帶任何參數(shù)

        如果目錄 是鏈接時:

        格式:pwd -P 顯示出實際路徑,而非使用連接(link )路徑。

        Linux系統(tǒng)中查看當(dāng)前路徑的命令:pwd命令實例

        例1:用 pwd 命令查看默認工作目錄的完整路徑

        命令:

        pwd

        輸出:

        [root@localhost ~]# pwd

        /root

        [root@localhost ~] #

        實例2:使用 pwd 命令查看指定文件夾

        命令:

        pwd

        輸出:

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

        [root@localhost soft]# pwd

        /opt/soft

        [root@localhost soft]#

        實例三:目錄連接鏈接時,pwd -P 顯示 出實際路徑,而非使用連接(link)路徑;pwd顯示的是連接路徑

        命令:

        pwd -P

        輸出:

        [root@localhost soft]# cd /etc/init.d

        [root@localhost init.d]# pwd

        /etc/init.d

        [root@localhost init.d]# pwd - P

        /etc/rc.d/init.d

        [root@localhost init.d]#

        實例 4:/bin/pwd

        命令:

        /bin/pwd [選項]

        選項:

        -L 目錄連接鏈接時,輸出連接路徑

        -P 輸出物理路徑

        輸出:

        [root@localhost init.d]# /bin/pwd

        /etc/rc.d/init.d

        [root@localhost init.d]# /bin/pwd --help

        [root@localhost init.d]# /bin/pwd - P

        /etc/rc.d/init.d

        [root@localhost init.d]# /bin/pwd - L

        /etc/init.d

        [root@localhost init.d]#

        實例五:當(dāng)前 目錄被刪除了,而pwd命令仍然顯示那個目錄

        輸出:

        [root@localhost init.d]# cd /opt/soft

        [root@localhost soft]# mkdir removed

        [root@localhost soft]# cd removed/

        [root@localhost removed]# pwd

        /opt/soft/removed

        [root@localhost removed]# rm ../removed -rf

        [root@localhost removed]# pwd

        /opt/soft/removed

        [root@localhost removed]# /bin/pwd

        /bin/pwd: couldn't find directory entry in “..” with matching i-node

        [root@localhost removed]# cd

        [root@localhost ~]# pwd

        /root

        [root@localhost ~]#

        補充:Linux系統(tǒng)如何查看當(dāng)前路徑

        下面阿D將向大家演示一下pwd命令的使用方法:

        1、 登錄遠程VPS,如何登錄,請查看“如何遠程管理linux操作系統(tǒng)”

        2、執(zhí)行以下命令:

        # pwd

        /home/samlee

        第一行為運行的命令,第二行的內(nèi)容為運行pwd命令后顯示的信息,即顯示用戶當(dāng)前所在的工作目錄的路徑為/home/samlee。

      3636863