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. I suppose there's a quota scheme that might
keep track of such data, but I've never really investigated it.
Less quickly:
sudo find / -type f -exec stat -c '%u:%g' {} \; > /tmp/filedb.txt
# user file count
cut -d: -f1 /tmp/filedb.txt | sort | uniq -c
# group file count
cut -d: -f2 /tmp/filedb.txt | sort | uniq -c
thanks,
galen
--
Paul Heinlein
[email protected]
45°38' N, 122°6' W
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug