in Linux, use the PWD command to view the full path to the current working directory. Simply put, you will have a current working directory every time you operate in a terminal. when unsure of the current location, pwd is used to determine the exact location of the current directory within the file system.
1. Command format:
pwd [ Options]
2. Command function:
View the full path to the current working directory
3. Common parameters:
normally without any parameters
If the directory is a link :
format:pwd-p shows the actual path, not thelinkpath .
4. Common examples:
Example 1: Viewing the full path of the default working directory with the PWD command
command:
Pwd
Output:
[BEGIN] 2015/12/21 16:27:33[[email protected] ~]# [[email protected] ~]# Pwd/root[end] 2015/12/21 16:27:41
Example 2: Viewing a specified file using the PWD command
[BEGIN] 2015/12/21 16:26:00[[email protected] doc]# Pwd/root/rsync-3.0.7/doc[end] 2015/12/21 16:26:10
Example 3: When a directory connection is linked, Pwd-p displays the actual path, not the connection path ; pwd shows the connection path
[BEGIN] 2015/12/21 16:30:44[[email protected] etc]# cd[[email protected] ~]# Cd/etc/[[email protected] etc]# ll |grep INI T.dlrwxrwxrwx. 1 root root one Dec 2 16:51 init.d, Rc.d/init.d[[email protected] etc]# CD Init.d/[[email Protect ED] init.d]# Pwd-p/etc/rc.d/init.d[end] 2015/12/21 16:42:49
Example 4:/bin/pwd
command:
/bin/pwd [options ]
Options:
-L directory connection link, output connection path
-P Output Physical path
Output:
[BEGIN] 2015/12/21 16:47:39[[email protected] init.d]# pwd-l/etc/init.d[[email protected] init.d]# Pwd-p/etc/rc.d/init . d[end] 2015/12/21 16:48:15
A linux pwd command every day