JP Vossen on 12 Nov 2011 11:28:02 -0800


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

[PLUG] Finding a /etc/group entry containing a user list


I have a list of 10 users and I'd like to see if there is an entry in /etc/group that already contains all or most of them. Unfortunately, the /etc/group file is large, not well maintained, and not sorted in any way at all. If there is not a group that contains all the users, I'd like a list of the groups that contain the most because I may be able to just add the missing ones.

I thought of chaining a bunch of greps together, but that's ugly, not scalable, and won't give me a list of partial matches.

I know I could write some Perl (or whatever) code to do this, but does anyone have a better trick?

Thanks,
JP
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|      http://bashcookbook.com/
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug