一個簡單的linux命令 pwd
更新時間:2016年12月22日 14:22:23 作者:liruopeng321
這篇文章主要介紹了一個簡單的linux命令pwd,pwd命令用于查看當前工作目錄的完整路徑,具有一定的參考價值,感興趣的小伙伴們可以參考一下
pwd命令主要用于查看當前工作目錄的完整路徑。
主要用法:pwd [option]
常用范例:
1.查看當前完整路徑
命令:pwd
輸出:
[root@localhost ~]# pwd /root [root@localhost ~]#
2.查看鏈接路徑
命令: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
特性:當前目錄被刪除了,而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 ~]#
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關文章
Ubuntu、Linux Mint一鍵安裝Chrome瀏覽器的Shell腳本分享
這篇文章主要介紹了Ubuntu、Linux Mint一鍵安裝Chrome瀏覽器的Shell腳本分享,本文直接給出實現(xiàn)代碼,需要的朋友可以參考下2015-03-03Linux tar 命令出現(xiàn) Cowardly refusing to create an empty archive
這篇文章主要介紹了Linux tar 命令出現(xiàn) Cowardly refusing to create an empty archive 錯誤解決辦法的相關資料,需要的朋友可以參考下2017-04-04shell腳本配合zabbix實現(xiàn)tomcat的故障自愈功能
這篇文章主要介紹了shell腳本配合zabbix實現(xiàn)tomcat的故障自愈,服務實現(xiàn)自愈的方式有通過shell腳本+定時任務的方式,藍鯨Pass故障自愈平臺,shell腳本+zabbix觸發(fā)器動作,本文給大家詳細介紹,需要的朋友可以參考下2022-03-03