Batch File Rename By File Extension in Unix
These are one-liners which batch rename files meeting a certain criteria under unix
These are very powerful command line tools. They have been used on FreeBSD, Linux, and MacOSX with success. But as with any batch file changing, you are advised to use them with caution. Backups are your friend!
# change .htm files to .html
for file in *.htm ; do mv $file `echo $file sed 's/\(.*\.\)htm/\1html/'` ; done
# change .html files to .htm
for file in *.html ; do mv $file `echo $file sed 's/\(.*\.\)html/\1htm/'` ; done
#change .html files to .shtml
for file in *.html ; do mv $file `echo $file sed 's/\(.*\.\)html/\1shtml/'` ; done
#change .html files to php
for file in *.html ; do mv $file `echo $file sed 's/\(.*\.\)html/\1php/'` ; done"