一個(gè)簡單的linux命令 pwd
pwd命令主要用于查看當(dāng)前工作目錄的完整路徑。
主要用法:pwd [option]
常用范例:
1.查看當(dāng)前完整路徑
命令: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
特性:當(dāng)前目錄被刪除了,而pwd命令仍然顯示那個(gè)目錄
[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)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Ubuntu、Linux Mint一鍵安裝Chrome瀏覽器的Shell腳本分享
這篇文章主要介紹了Ubuntu、Linux Mint一鍵安裝Chrome瀏覽器的Shell腳本分享,本文直接給出實(shí)現(xiàn)代碼,需要的朋友可以參考下2015-03-03linux shell(.sh)腳本編寫和運(yùn)行入門
這篇文章主要介紹了linux shell(.sh)腳本編寫和運(yùn)行入門,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09Linux tar 命令出現(xiàn) Cowardly refusing to create an empty archive
這篇文章主要介紹了Linux tar 命令出現(xiàn) Cowardly refusing to create an empty archive 錯(cuò)誤解決辦法的相關(guān)資料,需要的朋友可以參考下2017-04-04Linux 編程之進(jìn)程fork()詳解及實(shí)例
這篇文章主要介紹了Linux 編程之進(jìn)程fork()詳解及實(shí)例的相關(guān)資料,需要的朋友可以參考下2017-03-03linux下實(shí)現(xiàn)ftp自動(dòng)備份shell腳本
ftp命令把遠(yuǎn)程計(jì)算機(jī)上的文件傳輸?shù)奖镜赜?jì)算機(jī)時(shí),需要和用戶交互。怎樣使交互過程自動(dòng)化呢2013-01-01shell腳本配合zabbix實(shí)現(xiàn)tomcat的故障自愈功能
這篇文章主要介紹了shell腳本配合zabbix實(shí)現(xiàn)tomcat的故障自愈,服務(wù)實(shí)現(xiàn)自愈的方式有通過shell腳本+定時(shí)任務(wù)的方式,藍(lán)鯨Pass故障自愈平臺(tái),shell腳本+zabbix觸發(fā)器動(dòng)作,本文給大家詳細(xì)介紹,需要的朋友可以參考下2022-03-03linux 下實(shí)現(xiàn)sleep詳解及簡單實(shí)例
這篇文章主要介紹了linux 下實(shí)現(xiàn)sleep詳解及簡單實(shí)例的相關(guān)資料,需要的朋友可以參考下2017-06-06寫一個(gè)shell腳本實(shí)現(xiàn)視頻處理
Linux和Unix都擁有很多能夠處理圖像和視頻文件的應(yīng)用程序和工具,下面這篇文章主要給大家介紹了關(guān)于如何寫一個(gè)shell腳本來實(shí)現(xiàn)視頻處理的相關(guān)資料,需要的朋友可以參考下2022-07-07