extract file-extensions

on

this one was a bit more heavy to write.
i have this dir with lots of subdirs with lots of files. also hidden files. and directorynames with dots.

like:
./fotos/unsorted.2004/000 still todo/Other/DSC_4589.JPG
./tarred/fotos.tar_2005_10/scanned/all.tar

Now I’m curious about numbers of filetypes in this dir. In fact I’m only interested in the characters after the last dot (.).

find . -type f -name '*' | sed -e 's/.*\.\([^\.].*\)/\1/g' | tr "[:upper:]" "[:lower:]" | sort | uniq -c

Now I know I have some cleaning to do:

     1 jpeg
 43508 jpg
     4 kdenlive
   112 mp4
     3 mpg
   304 xml