亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

linux中pwd命令使用詳解

 更新時間:2015年01月08日 14:32:40   投稿:hebedich  
這篇文章主要詳細介紹了linux中pwd命令使用方法,及常用的實例分享,非常的全面,有需要的小伙伴們仔細研讀下吧

Linux中用 pwd 命令來查看”當前工作目錄“的完整路徑。 簡單得說,每當你在終端進行操作時,你都會有一個當前工作目錄。
在不太確定當前位置時,就會使用pwd來判定當前目錄在文件系統(tǒng)內(nèi)的確切位置。

1.命令格式:
 pwd [選項]

2.命令功能:
 查看”當前工作目錄“的完整路徑

3.常用參數(shù):
一般情況下不帶任何參數(shù)
如果目錄是鏈接時:
格式:pwd -P  顯示出實際路徑,而非使用連接(link)路徑。

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

復(fù)制代碼 代碼如下:

[root@localhost ~]# pwd
/root
[root@localhost ~]#

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

復(fù)制代碼 代碼如下:

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

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

復(fù)制代碼 代碼如下:

[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 輸出物理路徑
輸出:

復(fù)制代碼 代碼如下:

[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]#

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

 

復(fù)制代碼 代碼如下:

[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 ~]#

以上就是PWD命令的全部內(nèi)容了,小伙伴們是否了解了呢,有疑問就給我留言吧

相關(guān)文章

最新評論