Full parsing of Linux digital file permissions

Source: Internet
Author: User

In the beginning of contact with Linux, the understanding of file permissions is not very thorough, here is a detailed description of the digital file permissions and the correspondence between the letter file permissions to help beginners to Linux as soon as possible to complete the understanding of the file permissions, as soon as possible to learn Linux system deeper content.

Under Linux, when you view a list of detailed properties for all files under a path (LS-L), you will see the file's operation permissions, similar to the "Drwxr-xr-x" string.

This string of characters can be divided into 4 paragraphs of understanding, the structure of "D + File owner operation Rights + the file owner's group Operation Rights + operation Rights of others":

1. First paragraph: the letter "D" in the example, indicating the directory where the file is located

2. Second paragraph: example of the string "rwx", indicating the file owner's operation rights to this file

3. Third paragraph: example of the string "R-x", indicating the file owner of the group to the operation of the file permissions

4. Fourth: The string "R-x" in the example, which indicates that anyone except 2 or 32 has permission to manipulate this file

Typically, three numbers are used to represent the read, write, and execute permissions for a file:

Performed: 1

Write: 2

reads: 4

Write a random number: 755, this 3-digit number corresponds to the preceding paragraph: 7 corresponds to the second paragraph, 5 corresponds to the third paragraph, and 5 corresponds to the fourth paragraph.

Meaning:

7: The file owner's permission, 4+2+1=7, that is, the file owner to the file of the power to kill, read, write, execute casually.

5: Indicates the permissions of the group to which the file owner is located: 4+1=5, which is the file owner group that has read, execute, and write permissions on the file.

5: Ditto, the other person to the file only read, execute permissions, no write permission.

Specific Use-Example: chmod 755 file name.

This completes the Linux digital file permission content explanation, hoped to be helpful to you.

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.