Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

OK this is a basic question showing my ignorance of sysadmin matters...

Looking at the UNIX system I work on, my /etc/passwd entry says

my_name:x:uid:gid:comments:home directory:login shell

Then when I go and look at group 'gid' in /etc/group, I see


So how come /etc/passwd thinks I am a member of the group, but /etc/group doesn't? Am I a member of the group or aren't I?

Is this normal? Your help would be appreciated.

share|improve this question
up vote 13 down vote accepted

/etc/passwd shows each user's primary group. /etc/group shows users who have a given group as one of their supplementary groups. For example, my username dan has the group dan as its primary group, so that is what appears in the group field in /etc/passwd. The user dan is also in the groups wheel, mailadmin and svn, so the entries for those groups in /etc/group list dan in the final field, which denotes group members.

share|improve this answer
Thanks D_Bye - very helpful! – Monkeybrain Nov 7 '12 at 17:18

The usernames in /etc/group only contain users who are in the group as a supplementary group, not a primary group. Primary group information is stored in /etc/passwd. The initgroups(3) manpage was the only documentation I could find to indicate this:

       initgroups - initialize the supplementary group access list
       /etc/group          group database file
share|improve this answer
Fantastic - answers my question. Thanks @jordanm! – Monkeybrain Nov 7 '12 at 17:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.