Linux system pwd command how to use

Source: Internet
Author: User
Tags root directory

In a Linux hierarchy, users can use the mkdir command to create a new directory under any authorized directory, or they can use the CD command to convert from one directory to another. However, there is no prompt to tell the user which directory is currently in. To know the current directory, you can use the PWD command, which displays the entire path name.

Name

Print Working Directory

Use

Displays the path name of the working directory.

Grammar

PWD [-l |-p]

Describe

The PWD command writes the full path name (from the root directory) of the current directory to standard output. All directories are separated by/(slash). The first/represents the root directory, and the last directory is the current directory.

Sign

-L

If the PWD environment variable contains a filename that is not included. (point) or.. The absolute pathname of the current directory (point), the value of the PWD environment variable is displayed. Otherwise, the-l flag runs like the-P flag.

-P

Displays the absolute path name of the current directory. The absolute path displayed with the-p flag does not contain the name of the file that involves the symbolic link type in the absolute path of the path name.

Exit status

This command returns the following export values:

0 completed successfully.

"0 error occurred.

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.