/etc/group

Updated: October 28, 2024

This file stores information about the groups on your system.

Each line in /etc/group is in this format:

groupname:x:group_ID:[username[,username]...]

The fields are separated by colons and include:

groupname
The name of the group. Like a user's name, this can contain any characters except a colon (:), but you should probably avoid any of the shell's special characters. For more information, see Quoting special characters in Using the Command Line.
x
The password for the group. QNX Neutrino doesn't support group passwords.
group_ID
The numeric group ID.
username[,username]...
The user names of the accounts that belong to this group, separated by commas (,).

Here's a sample entry:

techies:x:123:michel,ali,sue,jake

Caveats:

If the total line length is longer than 1007 bytes, you will have to separate the group into two lines, like so:

groupname:x:group_ID:username1,username2,...,usernameM
groupname:x:group_ID:usernameM+1,usernameM+2,...,usernameN