Professional Documents
Culture Documents
CHGRP Command
CHGRP Command
CHGRP Command
• About chgrp
• chgrp syntax
• chgrp examples
• Linux and Unix commands help
About chgrp
Changes group ownership of a file or files.
Description
Change the group of each FILE to GROUP. With --reference, change the group of each FILE to that
of RFILE.
chgrp syntax
chgrp [OPTION]... GROUP FILE...
Options
-c, --changes Like verbose but report only when a change is made.
-f, --silent, --quiet Suppress most error messages.
Affect the referenced file of each symbolic link, rather than the symbolic link
--dereference
itself, which is default setting.
-h, --no- Affect symbolic links instead of any referenced file. This option is useful only on
dereference systems that can change the ownership of a symlink.
--no-preserve-root Do not treat '/' in any special way. This option is the default.
The following options modify how a hierarchy is traversed when the -R option is also specified. If
more than one of these options is specified, only the final one takes effect:
chgrp examples
chgrp hope file.txt
Change the owning group of the file file.txt to the group named hope.
chgrp -hR staff /office/files
Change the owning group of /office/files, and all subdirectories, to the group staff.