Change file group ownership (POSIX)
chgrp [-Rv] group file...
The chgrp utility lets you change the group ownership of one or more files. For each file you name, chgrp sets the file's group ID to that specified by the group operand.
If you invoke chgrp with the -R option, and chgrp attempts but fails to change the group ID of a particular file in a specified file hierarchy, it continues to process the remaining files in the hierarchy. The chgrp utility can fail to change the group ID of a file if you don't have appropriate permissions.
You must be root to change the group ownership from one group to another. Normal users can change the ownership of a group to themselves, but they can't change the ownership of a group to which they don't belong. |
Change file group of myfile to 27:
chgrp 27 myfile
Change file group of myfile to technical:
chgrp technical myfile
Entries in this file appear in the following format:
groupname::groupid:user[,user]...