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 the link path.
4. Common examples:
Example 1: Viewing the full path of the default working directory with the PWD command
Command:
Pwd
Output:
[Email protected] ~]# pwd
/root
[Email protected] ~]#
Example 2: Use the PWD command to view the specified folder
Command:
Pwd
Output:
[Email protected] ~]# cd/opt/soft/
[Email protected] soft]# pwd
/opt/soft
[Email protected] soft]#
Example 3: When a directory connection is linked, Pwd-p displays the actual path, not the connection path; PWD display is the connection path
Command:
Pwd-p
Output:
[Email protected] soft]# CD/ETC/INIT.D
[Email protected] init.d]# pwd
/etc/init.d
[Email protected] init.d]# pwd-p
/etc/rc.d/init.d
[Email protected] init.d]#
This article is from the "Linux Personal Summary" blog, please be sure to keep this source http://xuelinux.blog.51cto.com/9927651/1708489
One Linux command per day (3) [pwd command]