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.
- Solve Linux garbled characters
- Three Tips for improving Linux Management Efficiency
- Linux link file type
- 10 new Linux knowledge points
- Solve Linux grub startup Problems