Commands to view file permissions:
In Terminal input:
Ls-l xxx.xxx (xxx.xxx is the file name)
Then there will be similar messages, mostly these:
-rw-rw-r--
A total of 10 digits
Which: the front one-represents the type
The middle three rw-represents the owner (user)
Then those three rw-represent groups (group)
The last three r--represent others (other).
And then I'll explain the 9 digits in the back:
R indicates that a file can be read (read)
W indicates that the file can be written (write)
x indicates that the file can be executed (if it is a program)
-Indicates that the appropriate permission has not been granted
Now it's time to talk about modifying file permissions.
In Terminal input:
chmod o+w xxx.xxx
Give other people permission to write xxx.xxx this file
chmod GO-RW xxx.xxx
Represents the deletion of read and write permissions for groups and others in xxx.xxx
which
U on behalf of owner (user)
G represents the group where the owner resides
O stands for others, but not u and g (other).
A represents all people, including U,g and O.
R indicates that a file can be read (read)
W indicates that the file can be written (write)
x indicates that the file can be executed (if it is a program)
Where: Rwx can also be replaced by numbers
R------------4
W-----------2
X------------1
-------------0
Let's go:
+ means add permission
-Indicates delete permission
= indicates a permission to make it unique
When we all understand the above, then we often have some of the following permissions are easy to understand:
-RW-------(600) Only the owner has read and write permissions
-rw-r--r--(644) Only the owner has read and write permissions, and the group and other people only have Read permissions
-RWX------(700) Only the owner has read, write, execute permissions
-rwxr-xr-x (755) Only the owner has read, write, execute permissions, groups and other people only read and Execute permissions
-rwx--x--x (711) Only the owner has read, write, execute permissions, groups and other people only execute the permissions
-rw-rw-rw-(666) Everyone has access to read and write
-RWXRWXRWX (777) Everyone has access to read and write and execute
Ubuntu modify file Permission record