Linux命令--pwd

what?查看”當(dāng)前工作目錄“的完整路徑
1.命令格式:
pwd [選項]
2.命令功能:
查看”當(dāng)前工作目錄“的完整路徑
3.命令參數(shù):
一般情況下不帶任何參數(shù)
如果目錄是鏈接時:-P 顯示出實(shí)際路徑,而非使用連接(link)路徑。
eg:

1.目錄連接鏈接時,pwd -P 顯示出實(shí)際路徑,而非使用連接(link)路徑;pwd顯示的是連接路徑

[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

2.當(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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容