1 features
Change the access rights of the file. Mainly read, write, execute permissions.
2 Description 2.1 Types of permissions
R Read
W Write
X execute (or access to the directory)
x Append x attribute only if the target file is executable to some users or the target file is a directory
s set user or group ID at the same time
t sticky bit (delete or move)
2.2 Digital Permissions
Permissions can be replaced by four-bit octal digits, which are represented by:
First: 4 is suid, the file runs as the owner, 2 is Sgid, only the directory is set, the newly created file in the directory has the default setting of suid;1 as the sticky bit, which is understood as delete permission.
Second bit: Set permissions for the file owner.
Third bit: Set permissions for the group where the file owner resides.
Fourth bit: Set permissions for other group users.
2.3 Permission Objects
The owner of the U file
G users in the same group as the file owner
o Other groups of users
A All Users =ugo
2.4 operator
+ Add Permissions
-Delete Permissions
3 Common usage 3.1 Add File execution permissions to yourself
chmod u+x File
The difference from chmod file is that the latter clears other permissions, in addition to the EXECUTE permission.
3.2 Adding directories (and subdirectories) to everyone access permissions
Chmod-r +r File
3.3 Clear All permissions
CHMOD-RWXSTX file
Equivalent to chmod file
chmod common usage