1. Character notation
Type operation permissions
U +r
G -W
o =x
A
The type represents an object that changes permissions, and U represents the user of the file. G represents the group of all the files, O represents a non-user group of users. A means Ugo
Action + Represents the addition of permissions,-Indicates reduced permissions, = indicates permissions granted
Permission r means read only, W is writable, X is operational
[[Email protected] ~] # mkdir Perm
[[Email protected] ~] # CD Perm
[[email protected] perm] # mkdir Test
[[email protected] PERM] # CD Test
[[email protected] test] # touch Test1
[[email protected] test] # touch Test2
Here is the test order, see details
chmod u-w Test
chmod g+w Test
chmod ug+w Test
chmod ugo-x Test
chmod a+x Test
chmod o=w Test
chmod a= Perm
Chmod-r a+rwx Perm
2, digital notation
Permission numbers
R4
W2
X1
-0
For example, the rwx number means that 4+2+1=7, which is actually a binary representation, rwx three-bit bit,111, or 7
Examples:
chmod 577 Test
chmod 555 Test
Chmod-r 754 test//-r reference meaning recursive
Ways to set permissions for Linux files and folders