exiftool '-FileName<${DateTimeOriginal}_$Model.%e' -d %Y-%m-%d_%H-%M-%S%%-.c ./DSC_1703.JPG
Yes, the filename has a space in it because the EXIF Model tag has a space in it, but if you're like I am and don't want spaces, it's easy enough to cleanse all the spaces from your filenames (in this case, with underscores) using the following command:
rename 's/ /_/g' *.JPG
Other tags besides Model can be used, too; I happen to want my filenames with Model in them. Of course one can combine these into one shell script called something like
rename-myphotos.sh
. It could look something like this:#! /bin/bash
#
# Rename photos to something like:
# 2011-02-20_03-05-41-1_NIKON D40.JPG where filename is composed
# of date, time, "-" counter (the "." in the "%%-.c" causes the
# counter to start display "0" for non-duplicate filenames), EXIF
# Model tag, and original extension. THIS COMMAND DOES NOT LEAVE THE
# ORIGINAL FILENAME (it is like a "mv" not a "cp")
#
# Can replace ./ at end with directory name, filename, or filename
# pattern with wilcards.
#
# REMOVE "-n" FROM "rename" AND ADJUST FILENAME PATTERN AT END OF
# THAT LINE AS NECESSARY
exiftool '-FileName<${DateTimeOriginal}_$Model.%e' -d %Y-%m-%d_%H-%M-%S%%-.c ./
rename -n 's/ /_/g' ./