Lemme guess, you want to bulk rename hundreds of photos in a folder, and looking for ways to batch rename files to random characters.
One way is to use an application like Renamer, but then again it won’t do much in a trial version.
While randomizing file names in a folder shouldn’t be that hard, the process is something that could take a long time, especially when you consider that many photo libraries have thousands of images. However, through the power of Terminal and the use of a for-loop, it is possible to randomly rename an entire folder of images with one fell swoop.
We will show you the easiest way to do it using mac’s inbuilt utility called Terminal, and a bit of coding.
In Terminal first type
cd
(type one space after ‘cd’)
Then drag your directory to the Terminal window and press return. That will change to your image directory. Then paste
for i in *.jpg; do mv $i $RANDOM.jpg; done
The terminal will execute the script and depending on the number of images in your folder, you will see within some time, all your images will be renamed.
'-bash: syntax error near unexpected token `do'
Leave us comments if you have any issues and we will try to answer it.
Hey just wanted to let you know you saved my butt with this simple tutorial. Thanks! ????????
Glad it helped you !.
How do you alter this script to prepend the random number? Eg 3544concerto.mp3
will this work if the files are not JPG? Mine are PNG.
Yes it should work !
will this work if the files are not JPG? My files are PNG Screenshots.
It worked well but some of my photos are missing now.
Did they have the same name?
hey thank you for this script. It would solve my problem. But why I have after the process less images than bevor?