msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

07 Jul 2013 Another way to randomize filenames

Posted by

This post describes an easier way to randomize filenames using the command openssl compared to my previous post named Randomize filenames.

#!/bin/bash
for filename in *.JPG
do
mv "$filename" $(echo "$filename" | openssl rand -hex 3).JPG
done

After running this script the filenames can look something like this

26333c.JPG
a8c7a0.JPG
b16b22.JPG
d69a67.JPG
...

The rand option creates a random value from $filename.

Tags: , ,

Comments are closed.