chgrp

Change Group

chgrp [-fhv] [-R [-H | -L | -P]] group file …

chgrp sets the group ID of file.

-f force, ignore errors, ( except for usage errors) and doesn't query about strange modes (unless the user does not have proper permissions).
-R Change the group ID for the file hierarchies rooted in the files instead of just the files themselves.
With -R: override each other and the last one specified is used.
  -RP symbolic links are not from being followed. default.
  -RL symbolic links are followed.
  -RH symbolic links on the command are followed but not those encountered in the tree traversal
-h For symbolic link, the group ID of the link is changed not the target.
-v verbose, shows files as modified Non-standard and its use in scripts is not recommended.

group can be a group name or group ID.

The user invoking chgrp must belong to the group and be the owner of the file, or be the super-user.

Display the (effective, real and supplementary) group IDs the user is a member of.

> id -G
20 12 61 79 80 81 98 102 705 703 704 702 701 33 100 204 250 395 103 101 400

> id -p mgerman     | sed "s/ /\n/g"|sort|column |expand     #list mgerman's group names, and make it pretty
_analyticsusers             admin                           com.apple.sharepoint.group.3
_appserveradm               com.apple.access_ftp            com.apple.sharepoint.group.4
_appserverusr               com.apple.access_remote_ae      com.apple.sharepoint.group.5
_appstore               com.apple.access_screensharing-disabled everyone
_developer              com.apple.access_ssh-disabled       groups  staff
_lpadmin                com.apple.sharepoint.group.1        localaccounts
_lpoperator             com.apple.sharepoint.group.2        uid mgerman

Exits 0 on success, and >0 if an error occurs.

Files
/etc/group group ID file

See chown, group, passwd, symlink, chown, ls, fts