Created
October 31, 2022 17:52
-
-
Save whereisaaron/6546c6bee662a7daf562d36c3352f5e1 to your computer and use it in GitHub Desktop.
Create a collection of dummy files to use up space
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
START=${1:-1} | |
END=${2:-10} | |
for i in $(seq ${START} ${END}); do | |
filename=$(printf 'dummy-10GiB-%03d.bin' $i) | |
if [[ -f ${filename} ]]; then | |
echo "Dummy file ${filename} already exists" | |
else | |
echo "Creating dummy file ${filename}" | |
dd if=/dev/urandom of=${filename} bs=1M count=10240 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment