1. Introduction to Commands
The chgrp (change group) is used to set the owning group of each specified file to the specified value. If you use--reference, the owning group for each file is set to be the same as the specified reference file.
2. Usage
chgrp [options] ... User group File ... Or:chgrp [options] ...--reference= reference file ...
3. Options
4. Example 1: Modify the owning group of LOG1 to DBA
0 1 0 April :chgrp0 1 Root dba 0 April : Log1
Example 2:-V options
chgrp -v dba log1"log1" belongs to a group that has been reserved for DBA
Example 3:-r recursive modification
[Email protected] ~]#ls-LDdir1/drwxr-xr-x2Oracle DBA4096April - -: -dir1/[[Email protected]~]#chgrp-Rv dba Dir1"Dir1/log1"The owning group has been reserved for DBA"dir1/log2"the owning group has changed to DBA"Dir1"The owning group has been reserved for DBA
Example 4: The owning group can be an ID
0 1 0 April :chgrp00 1 0 April : Log1
Example 5: Change the owning group of LOG2 to the same as Log1
0 1 0 April : log11 root dba 0 April - :chgrp- v--reference=log1 log2" log2" belongs to a group that has been retained as root
One Linux command per day: chgrp