CHGRP: Change the group that the file belongs to
Chown: Changing the file owner
chmod: Features that change file permissions, SUID, SGID, Sbit, and so on
Change the group that belongs to, CHGRP (changes group).
CHGRP [-r] Group name file name
[[email protected] ~]# CHGRP users Install.log (the group that changed the file Install.log is users (the group must already exist)
Change owner, Chown
Chown [-r] Account name file or directory
[[email protected] ~]# Chown bin Install.log (change the owner of the file to the account bin)
[[email protected] ~]# chown root:root install.log (Change the file owner and group to root)
The above command can also be written as Chown Root.root Install.log But since many people like xx.xx when creating usernames, it is recommended to use:
In addition to use chown can also simply change the file belongs to the group Chown. Root Install.log
Change permissions, chmod
There are two ways to change permissions: the use of numbers and the use of symbols for permission changes
The basic rights of the Linux files are nine, respectively, owner/group/others three kinds of identities have their own read/write/execute rights,
With the Install.log as an example, its corresponding permission is-/rw-(owner)/r--(group)/r--(others)
1. Changing permissions in digital mode
In the array mode Change permission R represents 4,w on behalf of 2,x 1, then Install.log original permission is (4+2+0) (4+0+0) (4+0+0) =644
chmod [-r] XYZ file or directory ps:xyz represents the RWX attribute combined with the
Example: Please change the permissions of Install.log to (-rwxr-xr-x)
Answer: chmod 755 Install.log
2. Symbol type Change file permissions
In this way, you, G, and O represent user, group, others, and a represents all
Here we still take Install.log as an example
Set the user's permission to rwx chmod u=rwx Install.log
Set the permissions of user and group to Rwx,other to R-x chmod ug=rwx,o=r-x Install.log
Delete User's X permission chmod u-x Install.log
Add other's x permission chmod o+x Install.log
Add W chmod a+x Install.log to all members
Changing file properties and Permissions