命令簡介:
該命令用來顯示目前所在的工作目錄。指令英文原義:print work directory
執行權限 :All User
指令所在路徑:/usr/bin/pwd 或 /bin/pwd
命令語法:
pwd [OPTION]...
命令參數:
參數 |
長參數 |
描敘 |
-L |
--logical(無效) |
當目錄為連接路徑時,顯示連接路徑 |
-P |
--physical(無效) |
顯示實際物理路徑,而非使用連接(link)路徑 |
--help |
顯示命令在線幫助(該參數無法使用) |
|
--version |
顯示命令版本信息(該參數無法使用) |
使用示例:
1:查看pwd命令的幫助信息
1: root@DB-Server init.d]# man pwd
2: PWD(1) User Commands PWD(1)
3:
4: NAME
5: pwd - print name of current/working directory
6:
7: SYNOPSIS
8: pwd [OPTION]...
9:
10: DESCRIPTION
11: Print the full filename of the current working directory.
12:
13: -L, --logical
14: use PWD from environment, even if it contains symlinks
15:
16: -P, --physical
17: avoid all symlinks
18:
19: --help display this help and exit
20:
21: --version
22: output version information and exit
23:
24: NOTE: your shell may have its own version of pwd, which usually supersedes the version described here. Please refer to your shell鈥檚 documentation for details about the
25: options it supports.
26:
27: AUTHOR
28: Written by Jim Meyering.
29:
30: REPORTING BUGS
31: Report bugs to <bug-coreutils@gnu.org>.
32:
33: COPYRIGHT
34: Copyright 漏 2006 Free Software Foundation, Inc.
35: This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to
36: the extent permitted by law.
37:
38: SEE ALSO
39: The full documentation for pwd is maintained as a Texinfo manual. If the info and pwd programs are properly installed at your site, the command
40:
41: info pwd
42:
43: should give you access to the complete manual.
44:
45: pwd 5.97 May 2011 PWD(1)
46: (END)
47:
2:顯示當前目錄所在路徑 pwd
1: [root@DB-Server networking]# pwd
2: /etc/sysconfig/networking
3:顯示當前目錄的物理路徑 pwd –P
1: [root@DB-Server init.d]# cd /etc/init.d
2: [root@DB-Server init.d]# pwd -P
3: /etc/rc.d/init.d
4: 顯示當前目錄的連接路徑:pwd -L
1: [root@DB-Server networking]# cd /etc/init.d
2: [root@DB-Server init.d]# pwd -L
3: /etc/init.d
4: [root@DB-Server init.d]# pwd
5: /etc/init.d