CHGRP changing the owning user group
The group name to be changed must exist within the/etc/group file;
CHGRP [-R] Dirname/filename
-r: Continuous changes to the recursive, with all files and directories under the subdirectory updated to the new user group
Chown Changing the file owner
If you want all subdirectories or files under the directory to change the file owner at the same time, add the-r parameter directly
Chown [-r] Account name file or directory
Chown [-r] Account name : Group name file or directory
Chown [-r] Account name . Group name file or directory
chmod changing permissions
Number Types Change file permissions
[email protected] tmp]# lltotal4drwxr-xr-x.2Root root4096The A .: OneFoo[[email protected] tmp]#chmod thefoo/[email protected] tmp]#lsFoo[[email protected] tmp]# lltotal4D---------. 2Root root4096The A .: OneFoo[[email protected] tmp]#chmod 777foo/[email protected] tmp]# lltotal4drwxrwxrwx.2Root root4096The A .: OneFoo[[email protected] tmp]#chmod 641foo/[email protected] tmp]#lsFoo[[email protected] tmp]# lltotal4DRW-R----X.2Root root4096The A .: OneFoo[[email protected] tmp]#chmod 755foo/[email protected] tmp]# lltotal4drwxr-xr-x.2Root root4096The A .: OneFoo[[email protected] tmp]#
Symbol Type Change file permissions
[Email protected] tmp]#chmodu=rwx,g=rw,o=rw/tmp/foo/[email protected] tmp]# lltotal4DRWXRW-rw-.2Root root4096The A .: OneFoo[[email protected] tmp]#chmodu=rx,g+x,o-rw/tmp/foo/[email protected] tmp]# lltotal4Dr-XRWX---.2Root root4096The A .: OneFoo[[email protected] tmp]#chmodugo=rw/tmp/foo/[email protected] tmp]# L-bash:l: Command not found[[email protected] tmp]# lltotal4DRW-rw-rw-.2Root root4096The A .: OneFoo[[email protected] tmp]#chmodug=rw,o-rw/tmp/foo/[email protected] tmp]# lltotal4DRW-RW----.2Root root4096The A .: OneFoo[[email protected] tmp]#
Linux Basic Command-CHGRP/CHOWN/CHOMD