List Members of a Group in Linux

Written by
Date: 2014-09-06 12:25:20 00:00


Show the Members of a Group in Linux

Q. How can I know who are the users in sudo group for Ubuntu?

A. There is a command for that, but it is usually not installed by default. It is called members as one might imagine. If you are using Debian or Ubuntu install it with apt-get

sudo apt-get install members

Then just invoque it with the name of the group.

members sudo

You can of course use it with any other group name:

members adm

If you do not want to install the members command you can always use cat with grep or, just grep.

sudo cat /etc/group | grep sudo

Or

grep sudo /etc/group