Linux modify file and directory permissions chmod

  
        

1. Introduction to file permissions
There are 9 linux file permissions, three groups, owner, group, others, each group contains r, w, x three states.

2. Modify permissions based on numbers
r, w, x The three permissions are represented by numbers: r: 4 w: 2 x: 1 The permissions for each group are the three above. For example, the permission is; [-rwxrwx---] owner: rwx = 4 + 2 + 1 = 7 group: rwx = 4 + 2 +1 = 7 others: --- = 0 + 0 + 0 = 0 The corresponding permission is 770

chmod 770 test.log# Recursively modify the subdirectory chmod -R 770 test for example: [-rw-r--r--] corresponds to 644. The chmod 754 file permission is [-rwxr-xr--]

3. Modify the permissions according to the symbol type.
user, group, others are represented by u, g, o, respectively, and a means all. + join - subtract = set

chmod u=rwx, go=rx test.log# permission [-rwxr-xr-x] increase execution permission 
chmod a+w test.log# permission [-rwxrwxrwx] Delete execution permission 
chmod ax test.log# permission [-rw-rw-rw-] address: http://blog.csdn.net/yonggang7/article/details/29379595
Copyright © Windows knowledge All Rights Reserved