国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 操作系統 > 正文

pwd命令(轉)

2024-06-28 13:21:56
字體:
來源:轉載
供稿:網友
pwd命令(轉)

原文:http://www.CUOXin.com/peida/archive/2012/10/24/2737730.html

linux中用pwd命令來查看”當前工作目錄“的完整路徑。簡單得說,每當你在終端進行操作時,你都會有一個當前工作目錄。

在不太確定當前位置時,就會使用pwd來判定當前目錄在文件系統內的確切位置。

1.命令格式:

pwd[選項]

2.命令功能:

查看”當前工作目錄“的完整路徑

3.常用參數:

一般情況下不帶任何參數

如果目錄是鏈接時:

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

4.常用實例:

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

命令:

pwd

輸出:

[root@localhost~]#pwd

/root

[root@localhost~]#

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

命令:

pwd

輸出:

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

[root@localhostsoft]#pwd

/opt/soft

[root@localhostsoft]#

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

命令:

pwd-P

輸出:

[root@localhostsoft]#cd/etc/init.d

[root@localhostinit.d]#pwd

/etc/init.d

[root@localhostinit.d]#pwd-P

/etc/rc.d/init.d

[root@localhostinit.d]#

實例4:/bin/pwd

命令:

/bin/pwd[選項]

選項:

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

-P輸出物理路徑

輸出:

[root@localhostinit.d]#/bin/pwd

/etc/rc.d/init.d

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

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

/etc/rc.d/init.d

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

/etc/init.d

[root@localhostinit.d]#

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

輸出:

[root@localhostinit.d]#cd/opt/soft

[root@localhostsoft]#mkdirremoved

[root@localhostsoft]#cdremoved/

[root@localhostremoved]#pwd

/opt/soft/removed

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

[root@localhostremoved]#pwd

/opt/soft/removed

[root@localhostremoved]#/bin/pwd

/bin/pwd:couldn'tfinddirectoryentryin“..”withmatchingi-node

[root@localhostremoved]#cd

[root@localhost~]#pwd

/root

[root@localhost~]#


上一篇:mkdir命令(轉)

下一篇:cd命令(轉)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 凤山县| 东阿县| 仪陇县| 深圳市| 云龙县| 平顶山市| 二手房| 西乡县| 肇州县| 万盛区| 沈丘县| 临湘市| 武宣县| 浦江县| 蒙城县| 鞍山市| 荣昌县| 东光县| 浦县| 鹤壁市| 沐川县| 昌吉市| 中牟县| 台湾省| 北票市| 大同县| 碌曲县| 柳河县| 永修县| 阳新县| 吕梁市| 三都| 固原市| 竹北市| 西平县| 阿坝县| 北辰区| 龙海市| 黄冈市| 慈利县| 麻江县|