Now using the Ls-l command to view a list of files in the details format, you will see the following:
Total 5
Drwxr-x---4 user group 4096 00:37 filename
Drwxr-xr-x user group 4096 Mar 10 20:16 filename
-RW-------1 User group 524 00:40 A
-rw-r--r--1 user Group June B
A total of seven columns of information are displayed, from left to right:permissions, number of files, attribution user, attribution group, file size, creation date, file name
Special attention should be paid to the first column:
Drwxr-xr-x
A total of 10 locations, can be divided into 4 groups:
D rwx R-x R-x
The first group has only one character:
D folder
-Common documents
L Links
B Block Device file
C Character device file.
The remaining 3 groups are the permissions for the file belonging to the user, the attribution group, other users, or groups . We look at the format of it
RWX rwx rwx
R readable
W can write
X executable
Now it's time to talk about modifying file permissions.
In terminal input: chmod o+w xxx.xxx
To give other people permission to write xxx.xxx this file
chmod GO-RW xxx.xxx
Indicates deletion of Read and write permissions for groups and other people in xxx.xxx
which
U on behalf of owner (user)
G represents the group in which the owner is located
O on behalf of others, but not u and g (Other)
A represents all the people, including U,g and O.
R indicates that the 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 use numbers to replace
R------------4
W-----------2
X------------1
-------------0
Let's go:
+ indicates adding permissions
-Indicates delete permission
= means to make it a unique permission
When everyone is aware of the above, then some of our common permissions are easy to understand:
-RW-------(600) Only the owner has read and write permission
-rw-r--r--(644) Only the owner has read and write permission, the group and others only Read permission
-RWX------(700) Only the owner has access to read, write, execute
-rwxr-xr-x (755) Only the owner has the right to read, write, execute, group and others only read and execute
-rwx--x--x (711) Only the owner has permission to read, write, execute, group and others only execute
-rw-rw-rw-(666) Everyone has access to read and write
-RWXRWXRWX (777) Everyone has access to read and write and execute