sajad torkamani

Every Unix user belongs to exactly one primary group but can also belong to multiple secondary groups.

Primary group

Every user has exactly one primary group which you can see in /etc/passwd. This group is typically created when the user is created and has the same name as the user.

Used for:

How to view the primary group:

Primary group information is stored in etc/passwd.

Secondary group

A user can belong to multiple additional groups in addition to their primary group.

Used for:

How to view secondary groups

The information is stored in /etc/group.