Apple - May I have a list of "System" group names, and their respective gid(s)?

The command dscacheutil -q group will output all groups with their name, ID numbers, and list of members. Be warned, when I say it will output all the groups, I mean all the groups, including built-in system ones mortals were never meant to see. I'm just saying, don't freak out there are so many groups for a single-user system.

root as the superuser is in a group by itself and also implicitly a member of every other group. Any user account can be a member of multiple groups. On my system the only member of staff is root; admins are all in the admin group. wheel is another group name you'll frequently see for some system files; it's a popular group name on Linux systems to assign to files so that admins can edit them without using their password in sudo.

It should also be noted that Mac OS X supports access control lists that provide more granular control over file permissions than traditional Unix permissions; IIRC the + in the file permissions list indicates there are such extended permissions associated with the file.


Alternative methods for listinggroupsand theirgid:

List sorted by group name:

dscl . list /Groups PrimaryGroupID

List sorted by group gid:

dscl . list /Groups PrimaryGroupID | tr -s ' ' | sort -n -t ' ' -k2,2

List groups with members:

dscl . list /Groups GroupMembership

Note: neither dscacheutil nor dscl list members of the group staff other than root. Use dsmemberutil to confirm a member belongs to the group staff.

Example a user with uid 501:

dsmemberutil checkmembership -u 501 -g 20