As a result of researching how one can quickly (in one-liner) rename, on Linux (=Ubuntu in my case) all .JPG files in a directory tree to .jpg files, the following solution was found (borrowed from a discussion
here after fixing the typo's :) ):
find . -name *.JPG -exec rename 's/\.JPG$/\.jpg/i' {} +
It won't work on Mac though (a Mac user offered this one):
for i in `find . -name '*.JPG'`; do mv $i ${i/%JPG/jpg}; done
Thought it might be worth remembering :)
Nice tip thanks!
ReplyDeleteIn Ubuntu 12.04 I had to do it like this:
ReplyDeletefind . -name '*.JPG' -exec rename 's/\.JPG$/\.jpg/i' {} +
I modified to this: (for Ubuntu 13.10)
ReplyDeletefind ~/Downloads -name '.*' -prune -o -exec rename 's/\.jpg$/\.jpeg/i' {} +
find ~/Downloads -name '.*' -prune -o -exec rename 's/\.htm$/\.html/i' {} +