Siege Lion on the Way (iii) Linux (12)---directory and path to Linux

Source: Internet
Author: User

One, relative path and absolute path:

A, Absolute path: The path that is written by the root directory/start, for example/usr/share/doc

B, relative path: a path that is not written by the root directory/start.

Second, the relevant operation of the directory:

1. CD: Directory switch

CD ~vbird;

CD ~;<== switch to the current user's working directory

CD.; <== return to the previous level directory

Cd-;(back to previous directory)

Cd/usr/share;

CD share;

2. PWD: Displays the current directory

Pwd-p; <== shows the actual directory, not just the directory name of the connection file itself.

3, mkdir: Create directory, need to have permission

mkdir test; <== creates a new directory under the current working directory.

Mkdir-p Test/test1/test2; <== Create a directory recursively (not recommended);

Mkdir-m 711 Test2; <== directly set permissions on the file.

4, RmDir: Delete empty directory, note is empty directory.

RmDir test;

Rmdir-p Test1/test2/test3; <== is still not recommended for use. It is recommended to use the RM command.

Iii. variables for executing file paths: $PATH

1, Echo $PATH: Between the different paths to: Connect

2. New example: Path= "$PATH":/root

Related Article

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.