Linux 中 pwd 命令來檢視” 當前工作目錄” 的完整路徑. 簡單的説, 每當你在終端進行操作時, 你都會有一個當前工作目錄. 在不太確定當前位置時, 同樣可以使用 pwd 來判定當前目錄在檔案系統內的確切位置.
命令格式: pwd  [option]
命令功能: 檢視” 當前工作目錄” 的完整路徑
 
常用例項:
<1>檢視當前工作目錄的完整路徑
命令: pwd
eg:
[root@sqj ~]# pwd
/root
 
<2>顯示實際路徑, 而非使用連結 (link) 路徑
命令: pwd -P
eg:
[root@sqj init.d]# pwd
/etc/init.d
[root@sqj init.d]# pwd -P
/etc/rc.d/init.d
 
<3>/bin/pwd
命令: /bin/pwd [option]
引數:
-L  目錄連線連結時, 輸出連線路徑
-P  輸出物理路徑
eg:
[root@sqj init.d]# pwd
/etc/init.d
[root@sqj init.d]# /bin/pwd
/etc/rc.d/init.d
[root@sqj init.d]# /bin/pwd -L
/etc/init.d
[root@sqj init.d]# /bin/pwd -P
/etc/rc.d/init.d
 
<4>當前目錄被刪除了, 而 pwd 命令仍然顯示那個目錄
[root@sqj test]# pwd
/home/test
[root@sqj test]# rm ../test -rf
[root@sqj test]# pwd
/home/test
[root@sqj test]# cd ..
[root@sqj home]# ls
sqj