20

Tip #173   Count files by type

To find out the number of files of each type in your current directory try the following:

find ${*-.} -type f | xargs file | awk -F, '{print $1}' | awk '{$1=NULL;print $0}' | sort | uniq -c | sort -nr  

5 PHP script text 2 data 2 Zip archive data 2 GIF image data 1 PNG image data

(You may want to add this as an alias rather than type it in each time!)