Re: command to list all members of a group?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scot L. Harris wrote:

On Tue, 2004-07-06 at 12:17, Matt Brodeur wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Jul 06, 2004 at 11:54:26AM -0400, shane c branch wrote:

> However, I need to issue a command that does the opposite. I want to see > all the memembers of a given group. How do I do this?

   I'm sure there's a better way, but this should work, assuming you
have access to the group file:

$ awk -v FS=':' '/^GROUPNAME/ { print $4 }' /etc/group


This could likely be done in <5 characters of perl, but it's effectively Monday here and I don't want to think too hard.

why not:

grep groupname /etc/group

Replace groupname by the name of the group you are looking for.


Thanks.

Both seem to work equally well.

--
regards,

shane


-- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux