Rename all JPG file extensions to JPEG, recursively and handles sub-directories also.
#!/bin/bash function rename_extension { # Change all .jpg to .jpeg, for file in $1/*.jpg; do mv $file $1/`basename $file .jpg`.jpeg; echo $file; done; # Recurse directories. for d in $1/*; do if test -d $d; then rename_extension $d; fi; done; } dir=`pwd`; rename_extension $dir;