This bash one-liner is useful if you want to count all files by extension (or file type). Often, for me, I like writing scripts to handle files by type that are in a specific folder. When you have hundreds, or even thousands, of files that are in a folder, you could easily overlook a file. The only example I can think of at the moment is zip, rar, and 7z files. If you want to uncompress a bunch of files, but you didn't realize there was rar files or 7z files, then you could miss some of the data you were extracting.

Anyway, here is the bash one-liner for counting files by extension is a folder:

find . -type f | sed -n 's/..*\.//p' | sort | uniq -c | sort -rn

The output would look something like the following:

    461 zip
      3 dmg
      2 licence
      1 pkg
      1 flexpack
      1 exe

Hope this helps whoever might ever need to do this in there journey.