//View Tip #358
Similar Tips
» Duplicate directory tree
» Remove empty directories
» Directories and its size
» Find last modified files on a filesystem
» Checksum directory recursively

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Assign random names to all files in a folder (including subfolders!):

find . -type f -exec bash -c 'mv "$1" "./$RANDOM"' - {} \;


Note that this is a somewhat expensive operation, so it might take a few seconds for large numbers of files.


View Comments »




Comments 

Add your comment

Comments are currently disabled
Your Name:
Might fail, if $RANDOM returns the same number on two calls during the run.
Posted 2011-05-06 01:10:35

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit