Change suffix

For one file or many?

One file:
Code:
mv somefile.JPG somefile.jpg

Many files in one place (using bash):
Code:
for file in *.JPG; do mv $file ${file%.*}.jpg; done

Many files in many directories below the current directory (using bash):
Code:
for file in $(find . -name \*.JPG -print); do mv $file ${file%.*}.jpg; done

Since "mv" doesn't care to ask your permission, it'll happily overwrite files if it needs to. So use with caution.
 
Back
Top