/etc/group: Explanation & Insights
Information about user groups
In Linux and other Unix-like operating systems, the /etc/group
file is a text file that stores information about the groups on the system. Each line in the file represents a
group, and contains four fields separated by colons:
- The name of the group
- The group password (usually set to an asterisk to indicate that the password is stored elsewhere, such as in the
/etc/shadow
file) - The group ID (a unique numerical identifier for the group)
- A list of user names that are members of the group, separated by commas
Here is an example of what a group entry in /etc/group
might look like:
developers:*:1001:jane,john,bob
This entry defines a group called "developers"
with group ID 1001
, and lists three user names (jane
, john
, and bob
) as members of the group.
The /etc/groups
file is used by the operating system to determine which users belong to which groups, and is used to assign group permissions to files and directories. It is
typically managed by the groupadd
, groupmod
, and groupdel
commands, which are used to add,
modify, and delete group entries in the file.