Skip to content

Instantly share code, notes, and snippets.

@ricsiga
Created February 11, 2018 19:19
Show Gist options
  • Save ricsiga/5b6ea0b39edb65931b96acb5fc0b00fb to your computer and use it in GitHub Desktop.
Save ricsiga/5b6ea0b39edb65931b96acb5fc0b00fb to your computer and use it in GitHub Desktop.
create random files
#! /bin/bash
numberOfDirs=10
numberOfFiles=10
blockSize=100
for d in $(seq 1 $numberOfDirs); do
mkdir dir$(printf %03d "$d")
for n in $(seq 1 $numberOfFiles); do
dd if=/dev/urandom of=dir$(printf %03d "$d")/file$(printf %03d "$n").bin bs=$blockSize count=$((RANDOM + 1024)) 2> /dev/null
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment