Introduction to Commands
Use the pwd command in Linux to view the full path to the current working directory.
Command format
PWD [Options]
command functions and Parameters
Features: View the full path to the current working directory ; parameters: Normally without any parameters, if the directory is a link:
Format:pwd-p shows the actual path, not thelinkpath.
Common Instance Instance 1: View the full path of the default working directory with the PWD command
Command: PWD
[Email protected] ~]# Pwd/root[[email protected] ~]#
Instance2:To view a specified folder using the PWD command
Command: PWD
[[email protected] ~]# cd/opt/soft/[[email protected] soft]# Pwd/opt/soft[[email protected] soft]#
example three: When a directory connection is linked, Pwd-p displays the actual path, not the connection path; pwd shows the connection path
Command: Pwd-p
[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]#
Example 4:/bin/pwd
Command:/bin/pwd [ options ]
Option:-L directory connection link, output connection path;-P output physical path
[[email protected] init.d]#/bin/pwd/etc/rc.d/init.d[[email protected] init.d]#/bin/pwd--help[[email protected] init.d]#/bin/pwd-p/etc/rc.d/init.d[[email protected] init.d]#/BIN/PWD-L/ETC/INIT.D
Instance five: The current directory is deleted, and the PWD command still displays that directory
[[email protected] init.d]# cd/opt/soft[[email protected] soft]# mkdir ddd[[email protected] soft]# CD Ddd[[email Protect ED] ddd]# Pwd/opt/soft/ddd[[email protected] ddd]# rm.. /ddd-rf[[email protected] ddd]# pwd/opt/soft/ddd[[email protected] ddd]#/bin/pwd/bin/pwd:couldn ' t find directory entry In ":" with matching I-node[[email protected] ddd]# CD [[email protected] ~]# Pwd/root
Linux Command---PWD