Tuesday, October 13, 2009

Easiest way renaming file extension (in bulk)...

From uppercase to lowercase or vice versa.

In Linux,
1) All files in a directory
    $ for f in *.JPG; do mv "$f" "${f%JPG}jpg"; done
2) Files within subdirectory(ies) included
    $ for f in `find -name "*.JPG" -type f`; do mv "$f" "${f%JPG}jpg"; done
To learn more, go to Command line reference: Database and Operating Systems.

No comments:

Post a Comment