#!/bin/sh
find ${*-.} -type f -print | xargs file |
awk '{
$1=NULL;
t[$0]++;
}
end {
for (i in t) printf("%d\t%s\n", t[i], i);
}' | sort -nr
The first "find" line works. But the awk part does not work. I expect the count of file types sorted in descending order.