Linux show users belonging to a given group

by on January 30, 2014 · 0 comments· LAST UPDATED January 30, 2014

Fig. 01: lid command in action

The lid command is default command on RHEL / CentOS and many other distros to to show you information about groups containing user name, or users contained in group name. Type the command:

 
sudo lid user
sudp lid -g group
sudo lid -n user
sudo lid -n -g group

To see user list of cartoon group:
$ sudo lid -g cartoon
Sample outputs:

 tom(uid=1007)
 jerry(uid=1008)
 spike(uid=1009)
 tyke(uid=1010)
 butch(uid=1011)
 nibbles(uid=1012)
 quacker(uid=1013)

To find out more about jerry group membership type:
$ sudo lid jerry
Sample outputs:

 cartoon(gid=1009)
 tom(gid=1011)
 jerry(gid=1012)

In this example output jerry is a member of three groups.

TwitterFacebookGoogle+Found an error/typo on this page? Help us!

Examples and usage: Linux lid Command Examples

{ 0 comments… add one now }

Leave a Comment

Tagged as: