$linuxjunkies
>

GID

also: Group ID

GID (Group ID) is a numeric identifier that uniquely represents a user group in Linux. Every group on a system has a unique GID, used for access control and permission management.

A GID is a non-negative integer assigned to each group on a Linux system. While group names (like sudo or wheel) are human-readable, the kernel internally uses GIDs to track group membership and enforce file and directory permissions.

GIDs are stored in the system's /etc/group file, where each line contains the group name, password field, GID, and list of member usernames. For example: sudo:x:27:user1,user2 assigns GID 27 to the sudo group with members user1 and user2.

When you run a command or access a file, Linux checks your primary GID (from /etc/passwd) and supplementary GIDs (from /etc/group) to determine what resources you can access. The command id shows your GID and group memberships, while chgrp changes file group ownership to a specific GID.

Related terms