Linux Command -- chmod, linux -- chmod
Chmod: modify directory or File Access Permissions
Access permission:
Three read/write operations are allowed to access a file or folder.
Read: expressed as number 4
Write: Number 2
Run: represented by number 1
User Type:
One file can be accessed by three types of users.
1. The owner of this file is the person who created this file (owner)
2. users in the same group as the owner
3. Users in other groups
In linux, each user belongs to one user group and can belong to only one group. There are multiple users in the group.
Example:
-Rwxrwxrwx. 1 root 139 Sep 28 23:28 1.txt
First rwx: indicates that the owner has three read and write permissions.
The second rwx indicates that other members in the group where the owner is located also have three read and write permissions.
Third rwx: indicates that other group members have three read and write permissions.
Chmod 777 1.txt
777: Set the permissions of the Group with the master and the other group users to read and write.
7 = 1 + 2 + 4
Chmod-R 777/test
Indicates that you have set the permission to access the test directory for the group of the owner and other groups to read and write.
-R processes the specified directory and all files in its subdirectories.