Group is a name service database used to store group information on Unix-like operating systems. The sources for the group database (and hence the sources for groups on a system) are configured, like other name service databases, in nsswitch.conf. The database file is located at <code>/etc/group</code>. It contains fields representing the group name, group id, encrypted password, and users belonging to the group. These fields are stored in a structure defined in the header file <code><grp.h></code>.
The contents of the group database (and available groups) can be seen with a variety of tools:
The <code><grp.h></code> header file contains the functions <code>getgrgid</code> and <code>getgrname</code> to look up a group by its ID or Name, as well as the functions <code>setgrent</code>, <code>getgrent</code>, and <code>endgrent</code> to iterate through all groups.
The getent command can be used to fetch group information.
<pre> getent group </pre>
For a specific group called 'users': <pre> getent group users </pre>