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