1, CHGRP (change the file belongs to the user group)
CHGRP (transform file to user group) change Group
CHGRP user Group filename # # #便是这个格了. If the entire contents are changed, the plus-r parameter is used for recursion.
Example: Chgrp-r user smb.conf
2. Chown (change file owner)
Format: chown-r-H User name file/Catalog
The-r option represents the same operation for files in all subdirectories, and the-h option means that the target file that the link points to is not affected when the owner of the symbolic link file is changed.
Note: Once ownership of a file is given to another user, it is no longer possible to reclaim its ownership and ultimately only to the system administrator.
Chown User name: User group: File/Catalog
If the entire contents are changed, the plus-r parameter is used for recursion.
Example: Chown-r root/etc/config.cfg
Chown-r Root:root/home
3, chmod (change file attributes)
+ hint add permission,-hint to dismiss permission, = imply only set permission.
R implies readable, W implies writable, X implies can be implemented, x implies that only if the file is a subdirectory, presumably the file has been set up for implementation.
--version: Performance version
By letter notation
Example 1: Set the file file1.txt to be read by all people:
chmod ugo+r File1.txt
U (user) represents the current user, the first three-bit 2-4-bit
G (group) represents the group in which the second three-bit 5-7-bit
O (Other) on behalf of the other, in the third three-bit 8-10-bit
Example 2: Set the file file1.txt to be read by all people:
chmod a+r File1.txt
In numerical notation
Permissions for User, Group, and other.
R W X
- - - - - - - - - -
111 111 111
The decimal that each digit represents by using the binary algorithm
R=4,w=2,x=1
To rwx the attribute then 4+2+1=7;
To rw-the attribute then 4+2=6;
To r-x the property, 4+1=5.
Linux in Chown, chmod, chgrp