linux chmod command to change file permissions and digital rights practice summary

 

 Properties command chmod change the permissions

 

 chmod is used to change the file or directory permissions command, but only the owner of the file owners and have such a super-user root privileges. Changed file or directory permissions chmod by two methods: one is by a method to set permissions and rights letters operator expression; the other is to use a digital method (commonly) set permissions. The following were introduced.

 

1) chmod digital rights method (recommended)

  Using digital rights set permissions command format is as follows:

     chmod [filename] number combinations

     chmod digital grammar simple and intuitive, permission lists represented by a combination of numbers in Table 4-1, the combination of three octal 3 to represent a combination of permissions of the user class files.

 

 

 

 

 

 

chmod 755 test.txt 
ls -ld test.txt
chmod 711 test.txt

 

 

 

If we want to change only Open Directory permissions, do not add any parameters when using the chmod command. If you want all files or sub directories following changes also need to use -R parameter;

chmod permissions character representation

 

 

 

 

 Operation Example

chmod u-x test.txt 

 

 

chmod g+r test.txt 
ls -l test.txt 
chmod g=w,o-x test.txt 
ls -l test.txt 

 

Guess you like

Origin www.cnblogs.com/dongxu2019/p/11598009.html