Mac OS/Linux: Batch rename files to random name

This is probably most used line in terminal for me:

Batch rename files and generate random names

for i in *.jpg; do mv "$i" $RANDOM.jpg; done

also batch changing extension of files (for example make lower case)

for file in *.JPG; do
    mv "$file" "`basename $file .JPG`.jpg"
done

 

Leave a Reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *