sean finney on 13 Nov 2011 04:58:07 -0800

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

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

On Sat, Nov 12, 2011 at 02:54:13PM -0500, JP Vossen wrote:
> But the original point is, I don't know what group to use.  I'm
> looking for the group that already contains the most members of my
> list, so that a) I don't need to create a new group and b) I need to
> add the fewest users to that group to that it contains everyone from
> my list.

something like this?

for group in `groups $users | cut -d: -f2-`; do
	echo $group
done | sort | uniq -c | sort -n


Philadelphia Linux Users Group         --
Announcements -
General Discussion  --