How do you list users in a solaris group

I need to list all users in a group. This is a large unix site running nis+.

getent group <goupname>

That worked great. How do you learn this stuff? Thanks

Hey gill , you can go for one more command 'logins' which will show you all the users logged into ur system put a grep for the particular group

#logins | grep `cat /etc/group | grep <groupname> | cut -d ':' -f4 `

check out the syntax once am not sure but you will get all the users of a group logged in your system. Bye..

I needed the list of all users in a group, not just the ones logged in and reborg's response was exactly what I needed. But I tried the logins cmd for grins and found out that root didn't think I should be running that one.

This will also work in other UNIX versions:

grep "^groupname" /etc/group

At least, for local groups... :slight_smile:

It's good to know both ways as "getent" is not also available.

saainaath gets the UUOC award. :smiley: