How to view and modify file read and write permissions under Linux system

  
                  View the file permission statement: In the terminal input: ls -l xxx.xxx (xxx.xxx is the file name) Then there will be similar information, mainly these: -rw-rw-r-- A total of 10 The number: the first one - represents the middle of the type, the three rw- represents the owner (user) and then the three rw- represents the group (group) the last three r-- represents the other (other) Then I will explain the following 9 digits: r means that the file can be read (read) w means that the file can be written (write) x means the file can be executed (if it is a program) - indicating the corresponding Permissions have not yet been granted. Now let's talk about modifying file permissions. Enter in the terminal: chmod o+w xxx.xxx means to give others permission to write xxx.xxx file chmod go-rw xxx.xxx means delete xxx.xxx Groups and other people's read and write permissions: u represents the owner (user) g represents the group in which the owner is located o represents other people, but not u and g (other) a represents all people, That is, including u, g, and or The piece can be read (read) w means that the file can be written (write) x means the file can be executed (if it is a program) where: rwx can also use numbers instead of r ----------- -4 w -----------2 x ------------1 - ------------0 Action: + means add permission - Indicates that the delete permission = means to make it the only permission. After everyone understands the above, then the following common permissions are easy to understand: -rw------- (600) Only all Only have the right to read and write -rw-r--r-- (644) Only the owner has the right to read and write, the group and others have only read permission -rwx------ (700 Only the owner has the right to read, write, and execute -rwxr-xr-x (755) Only the owner has read, write, execute permissions, groups and others have read and execute permissions only -rwx-- X--x (711) Only the owner has read, write, execute permissions, groups and others who only have permission to execute -rw-rw-rw- (666) Everyone has read and write permissions -rwxrwxrwx ( 777) Everyone has the right to read, write, and execute

Copyright © Windows knowledge All Rights Reserved