How do I change the suffix .JPG to .jpg in the terminal / UNIX ?
macbri Mac (r)evolution Aug 26, 2008 #2 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.
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.