Fully parse Linux digital file permissions

Source: Internet
Author: User

When I first started to access Linux, I did not have a thorough understanding of the file permissions. Here I will introduce in detail the correspondence between the digital file permissions and the letter file permissions, to help beginners of Linux quickly understand the file permissions and learn more about the Linux system as soon as possible.

In Linux, When you view the detailed attribute list of all files in a path (ls-l), you will see the operation permission of the file, similar to the string of "drwxr-xr-x.

This string can be divided into four sections. The structure is "d + file owner operation permission + file owner group Operation permission + other people's operation permission ":

1. Section 1: the letter "d" in the example indicates the directory where the file is located.

2. Section 2: the string "rwx" in the example indicates the operation permission of the file owner.

3. In the third section, the string "r-x" in the example indicates the operation permissions of the file owner's group on some files.

4, section 4. the string "r-x" in the example indicates the operation permission of anyone except 2 and 3 for this file.

Generally, three numbers are used to indicate the ACL for reading, writing, and executing a file:

Run: 1

Write: 2

Read: 4

Write a number: 755. The three digits correspond to the preceding segments: 7 corresponds to the second segment, 5 corresponds to the third segment, and 5 corresponds to the fourth segment.

Meaning:

7: indicates the permission of the file owner. The value 4 + 2 + 1 = 7 indicates that the file owner has the power to kill the file and read, write, and execute the file at will.

5: indicates the permission of the group in which the file owner is located: 4 + 1 = 5. That is, the group in which the file owner is located has the read and execution permissions on the file and has no write permissions.

5: Same as above. Others have only read and execute permissions on the file and have no write permission.

Use -- Example: chmod 755 file name.

This completes the explanation of the content of the Linux digital file permission, hoping to help you.

  1. Solve Linux garbled characters
  2. Three Tips for improving Linux Management Efficiency
  3. Linux link file type
  4. 10 new Linux knowledge points
  5. Solve Linux grub startup Problems

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.