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?

JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"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         --
Announcements -
General Discussion  --