Tag Archives: crap

super crappy script to make a ton of directories and files

needed to create a really quick script to just generate a ton of directories and files to fill them mainly to create something to test backups with. ┬áit’s not quite elegant, but to be honest it’s pretty quick and got the job done, anyway…

 

#!/bin/bash
# a script to create content, creates 1500 directories, a 1MB file and a %K file and copies it into all subdirs
#creates the dummy content files
dd if=/dev/zero of=dummy bs=1024 count=1024
dd if=/dev/zero of=dummysmall bs=1024 count=5
#creates 1500 directories in current directory
mkdir foo{1..1500}
#copies the dummy files
find . -type d -exec cp dummy {}/ \;
find . -type d -exec cp dummysmall {}/ \;
#clean up
rm -r dummmy dummysmall
echo "done!"
Advertisements
Tagged , ,
Advertisements