I would like to rename all of my files of my USB device randomly. Indeed, in my car, my tuner has not the random function.I think I can do it with PHP ... but I'm pretty sure it is possible to do something shorter in shell script, right?An idea?
rename randomly files on a USB device
shell script;rename
Assuming that you are running Linux, that you want to randomly order all files in the current directory and that no file name contains a newline:printf '%s\n' * | shuf | nl -n rz -s - |while IFS= read -r name; do  mv -- ${name#*-} $namedoneThe printf command prints the file names, one per line. shuf applies a random permutation to the input lines. nl adds prefixes like 000001-, 000002-, etc. to each line. The while loop iterates over all the lines. The mv command renames foo.mp3 to 000001-foo.mp3, etc.