Linux Command---PWD

Source: Internet
Author: User

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

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.