On Tue, May 08, 2012 at 11:40:23AM -0400, Thanigai rajan wrote:
> I want to list the users belongs to particular group.
> 
> For this I executed the command  "grep -i groupname /etc/group" . This
> shows entries only when the user is added as secondary group.
> 
> While searching the web , I found a command "members" with an option
> --secondary for Debian based distros.
> 
> Is there any command  same as "members"  in redhat based distros ?

This would be a classic use case for awk. Split fields by colons and
then display all the fourth fields where the first field is the group
name:

awk 'BEGIN { FS = ":" } $1 ~ /powerdev/ { print $NF}' /etc/group

I can help further if needed.

Thanks.

Kumar
-- 
:
####[ Linux One Stanza Tip (LOST) ]###########################

Sub : Bothered by spam ?                             LOST #354

Spamassassin tries to figure out heuristically if a message is
spam. It does this by applying many rules to the  message, and
assigning each rule a score (positive OR negative) ...  If the
score goes above a predefined number, it's flagged as spam and
you can do the rest. [Visit: http://www.spamassassin.org].

####[ajitabhpandey (at) users.sourceforge.net]################
:
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to