One linux command every day (3): pwd command link: One linux command every day (1): ls command http://www.2cto.com/ OS /201210/163049.html#linuxlinuxcommand every day (2): cd command quit...
One linux command every day (3): pwd command link: One linux command every day (1): ls command http://www.2cto.com/os/201210/163049.html ; One linux command every day (2): cd command http://www.2cto.com/os/201210/163050.html In Linux, run the pwd command to view the complete path of the "current working directory. To put it simply, whenever you operate on a terminal, you will have a current working directory. If you are not sure about the current location, pwd is used to determine the exact location of the current directory in the file system. Www.2cto.com 1. command format: pwd [option] 2. command function: view the complete path of "current working directory" 3. common parameters: generally, no parameters are included. if the directory is a link, the actual path is displayed in the format of pwd-P, rather than the link path. 4. common instance: instance 1: Use the pwd command to view the full path of the default working directory www.2cto.com command: pwd output: [root @ localhost ~] # Pwd/root [root @ localhost ~] # Instance 2: Use the pwd command to view the specified folder. Command: pwd output: [root @ localhost ~] # Cd/opt/soft/[root @ localhost soft] # pwd/opt/soft [root @ localhost soft] # www.2cto.com instance 3: Directory connection, pwd-P shows the actual path instead of the link path. pwd displays the connection path command pwd-P output: [root @ localhost soft] # cd/etc/init. d [root @ localhost init. d] # pwd/etc/init. d [root @ localhost init. d] # pwd-P/etc/rc. d/init. d [root @ localhost init. d] # instance 4:/bin/pwd www.2cto.com command:/bin/pwd [option] option:-L directory connection, output connection path-P output physical path output: [root @ localhost init. d] #/bin/pwd/etc/rc. d/init. d [root @ localhost init. d] #/bin/pwd -- help [root @ localhost init. d] #/bin/pwd-P/etc/rc. d/init. d [root @ localhost init. d] #/bin/pwd-L/etc/init. d [root @ localhost init. d] #
Instance 5: the current directory is deleted, and the pwd command still displays the output of the directory www.2cto.com: [root @ localhost init. d] # cd/opt/soft [root @ localhost soft] # mkdir removed [root @ localhost soft] # cd removed/[root @ localhost removed] # pwd/opt/soft/ removed [root @ localhost removed] # rm .. /removed-rf [root @ localhost removed] # pwd/opt/soft/removed [root @ localhost removed] #/bin/pwd: couldn't find directory entry in ".. "with matching I-node [root @ localho St removed] # cd [root @ localhost ~] # Pwd/root [root @ localhost ~] #
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service