Now use the Ls-l command to view a list of files in the details format, and you will see the following:
Total 5
Drwxr-x---4 user group 4096 Mar 00:37 filename
Drwxr-xr-x user group 4096 Mar 10 20:16 file name
-RW-------1 User group 524 Mar 00:40 A
-rw-r--r--1 user Group, June, B
A total of seven columns of information are displayed, from left to right in turn:PermissionsNumber of files,Attribution to users,Attribution Group,File size,Creation date,File name
One of the special things to note is 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
-Normal file
L Link
B-Block device files
C-character device file.
The remaining 3 groups are attribution users, attribution groups, other users or groups of permissions for the file. We look at the format of it
rwx rwx rwx
R Readable
W Writable
X executable
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
Linux file types and how to view, modify file read and Write permissions