Quote:
Originally Posted by jhowell
The file counts seem off. What command gave you those results?
|
Code:
find -type f -name \*\.\* -printf '%f\0%s\n' | gawk '
BEGIN {
FS = "\0";
}
{
split($1, a, ".");
ext = tolower(a[length(a)]);
files[ext] += 1;
size[ext] += $2;
}
END {
PROCINFO["sorted_in"] = "@ind_str_asc";
for (ext in files) {
"numfmt --grouping " files[ext] | getline neatfiles
"numfmt --to=iec-i --suffix=B --format='%.1f' " size[ext] | getline neatsize
print "*." ext " " neatfiles " files, " neatsize;
}
}'