1. Command name: chmod
Execution permission: All Users
Function Description: Change the file or directory permissions.
Syntax: chmod [{Ugo} {+-=}{ rwx}] [file or directory]
[Mode = 421] [file or directory]
Add or remove permission files or directories to or from the CHMOD User Type
Add the execution permission [root @ localhost ABC] # chmod U + x a to the owner of file a minus the read permission [root @ localhost ABC] # chmod o-r A sets the read and write permissions for the group to which file a belongs. [root @ localhost ABC] # chmod g-RW
Authorize by number
Rwx read/write execution
R ---> 4, W ---> 2, X ---> 1
For example: rwxr-XR -- this permission corresponds to 754
RW-r-X -- X. The permission corresponds to 651.
Set the read/write execution permission rwx for the owner of File A, and the read/write permission of the group RW-. If the owner has the read permission r --, the corresponding number is: 764 [root @ localhost ABC] # chmod 764
A user has the write (w) permission on a directory, which means that the user can create and delete files in the directory, even if the user has no write (w) permission on the files in the directory
2. Command name: chown
Execution permission: All Users
Function Description: Change the owner of a file or directory.
Syntax: chown user [file or directory]
Change the owner of file a to luxh [root @ localhost ABC] # chown luxh
3. Command name: chgrp
Execution permission: All Users
Function Description: Change the group to which a file or directory belongs.
Syntax: chgrp [user group] [file or directory]
Change the group of file a to ADM [root @ localhost ABC] # chgrp ADM a [root @ localhost ABC] # ls-l a-rwxrw-r --. 1 luxh ADM 0 Nov 15 05:22
4. Command name: umask
Execution permission: All Users
Function Description: displays and sets the default permissions for files.
Syntax: umask [-S]
-S displays the default permissions of new files or directories in the form of rwx
[Root @ localhost ABC] # umask0022 [root @ localhost ABC] # umask-su = rwx, G = RX, O = RX [root @ localhost ABC] #
0022 meaning:
0 -- Special Permission bit;
022 -- user permission bit, permission mask value, actual permission value: 777-022 = 755
Use: umask mask value can change this value, but it is not recommended to change this value
Linux permission rules: the executable (x) permission cannot be granted to files created by default.