Once upon a time, Karl-Olov Serrander <m11...@abc.se> said:
> On Wed, 21 Apr 2010, Natxo Asenjo wrote:
> > On Wed, Apr 21, 2010 at 12:39 AM, David Bartmess <dingod...@edingo.net> 
> > wrote:
> >> This is a basic linux question, but how do I find out what users are
> >> included in a given group?
> >>
> >> Thanks!
> >
> > getent group <groupname> should do the trick.
> 
> But that doeas not show users which has groupname as the primary group.

No, for that you have to list all users and look at the primary group
field.

getent passwd | grep "^[^:]*:[^:]*:[^:]*:$(getent group <groupname> | cut -d: 
-f3):"

Primary/aux groups in Unix are set up in a less-than-efficient way for
searching.
-- 
Chris Adams <cmad...@hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.
-- 
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Reply via email to