Re: [PLUG] count files owned by each uid

2017-12-15 Thread Robert Citek
On Fri, Dec 15, 2017 at 12:52 PM, Galen Seitz wrote: > find / -path /tmp -prune -o -path /sys -prune -o -path /proc -prune -o > -printf %u:%g\\n | awk '{usergroup[$0]++}; END {for(key in usergroup) printf > "%-20s %d\n",key,usergroup[key]}' You could also limit find to the filesystems that you

Re: [PLUG] count files owned by each uid

2017-12-15 Thread Galen Seitz
On 12/15/17 11:55, Galen Seitz wrote: > Hi, > > Can anyone suggest a quick way to get a count of the number files owned > by each uid, or alternatively, print each unique uid that exists in the > filesystem? Bonus points for doing the same thing for gid's in the same > pass. Thanks for the other

Re: [PLUG] count files owned by each uid

2017-12-15 Thread Michael
Depending on your definition of quick: ls -lR | grep ^[d-] | perl -ane '$user{$F[2]}++; $group{$F[3]}++; END{ print " Users\n"; for $s (keys %user) {print "$s $user{$s}\n"} print " Groups\n"; for $s (keys %group) { print "$s $group{$s}\n"}}' On 2017-12-15 11:55, Galen Seitz wrote: Hi,

Re: [PLUG] count files owned by each uid

2017-12-15 Thread Paul Heinlein
On Fri, 15 Dec 2017, Galen Seitz wrote: Hi, Can anyone suggest a quick way to get a count of the number files owned by each uid, or alternatively, print each unique uid that exists in the filesystem? Bonus points for doing the same thing for gid's in the same pass. Quickly? Probably not.

Re: [PLUG] count files owned by each uid

2017-12-15 Thread Russell Senior
First knee jerk response is find. Do you just want normal files? or other things too, like directories, devices, links, et al? On Fri, Dec 15, 2017 at 11:55 AM, Galen Seitz wrote: > Hi, > > Can anyone suggest a quick way to get a count of the number files owned > by each uid, or alternatively,

[PLUG] count files owned by each uid

2017-12-15 Thread Galen Seitz
Hi, Can anyone suggest a quick way to get a count of the number files owned by each uid, or alternatively, print each unique uid that exists in the filesystem? Bonus points for doing the same thing for gid's in the same pass. thanks, galen -- Galen Seitz gal...@seitzassoc.com __