Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Rename files in bash
# rename from *.JPG to *.jpg
for x in *.JPG; do mv "$x" "${x/.JPG}".jpg; done
rename 's/\.JPG/\.jpg/' *.JPG
#strip spaces
rename 's/ //' *.JPG
# upper to lower case
rename 'y/A-Z/a-z/' *.JPG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment