As far as I know, there is no standard Linux command to find out the users that are members of a given group. Intuitively, you would think there would be a command like members that takes the group name as a parameter. Unfortunately, it seems that no such command exists. In lieu of this command, you can simply grep the file /etc/group like this:
grep "^thegroupname:" /etc/group
Obviously, you need to replace thegroupname with the group you are searching for. The character ‘^’ means “beginning of line”. The character ‘:’ is the field separator between the group name and the group password in the group file.
If this tip helped you, please leave me a comment or send me an email!







You can get a little utility called ‘members’ (available in the Debian repositories) which does the same thing. i.e. ‘members users’ shows everyone in the group users in a format similar to the reverse utility, ‘groups’ (which shows what groups a user is in).