Find File Extension Statistics For a Directory on FreeBSD
I recently needed to find how many of each filetypes existed in a given directory. This is the command I used to get the desired data.
- Find filetype usage in a given directory:
find /path/to/data/ -type f -and -print | egrep -io '\.[^.]*$' | sort | uniq -c | sort -rn