Skip to content

Instantly share code, notes, and snippets.

@mtantawy
Last active September 5, 2017 09:10
Show Gist options
  • Select an option

  • Save mtantawy/7a80b5477c74e6223260801327417f6d to your computer and use it in GitHub Desktop.

Select an option

Save mtantawy/7a80b5477c74e6223260801327417f6d to your computer and use it in GitHub Desktop.
Shits random data in equaly sized files.
#!/bin/bash
if [ $1 == "-h" ];
then
echo "Shits random data in equaly sized files.";
echo "Usage: $0 #ITERATIONS #BLOCKS";
exit
fi
ITERATIONS=$1
BLOCKS=$2
for i in $(eval echo {1..$ITERATIONS})
do
echo "Iteration: $i starting"
dd if=/dev/urandom of=shit$i count=$BLOCKS bs=1m
df -h
echo "Total Size: "
du -h -d 1
echo "Iteration: $i ended"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment