bash script to sort files by extension
I'm trying to write a simple bash script to sort files based on their extensions. Mostly this is for sorting images. I would like to be able to go into a directory which may contain any combination of several filetypes and put them into separate directories.
Basically I'm thinking of this being a series of if/thens... sort of like this:
if [ there are any files ending with .tif ]
mv *.tif tif/
and so on for .jpg, .dng, etc...