Linux in pwd Command to view ” Current working directory ” Full path to . Simply put , Whenever you operate at the terminal , You will have a current working directory . When the current position is uncertain , Can also be used pwd To determine the exact location of the current directory in the file system .

Command format : pwd  [option]

Command function : see ” Current working directory ” Full path to

Common examples :

<1> View the full path of the current working directory

command : pwd

eg:

[root@sqj ~]# pwd

/root

<2> Show actual path , Instead of using links (link) route

command : 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

command : /bin/pwd [option]

parameter :

-L   When directory connection links , Output connection path

-P   Output physical path

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> The current directory has been deleted , and pwd The command still displays that directory

[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

Technology