Create many files of random size

Categories General Info

I am not sure why you would want to use a command like this but I am sure there is some reason for it, so here ya go;

 $ for i in $(seq 1 1000); do let "size = ($RANDOM/100)"; dd if=/dev/urandom \ of=file-$i count=$size 2>/dev/null;done

Maybe if you want to prank your cubemate or something by adding 1000 files to his desktop, it would be useful. Be creative. Let me know the best use for this.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.