Rename all the file extenstions in a directory

From thelinuxwiki
Jump to: navigation, search

Rename all the file extenstions in a directory(JPG to jpg in this example):

for file in *.JPG ; do mv $file `echo $file | sed 's/\(.*\.\)JPG/\jpg/'` ; done