Skip to content

Instantly share code, notes, and snippets.

@deltheil
Created June 4, 2012 15:04
Show Gist options
  • Save deltheil/2868896 to your computer and use it in GitHub Desktop.
Save deltheil/2868896 to your computer and use it in GitHub Desktop.
Create a file of given size with random data
# `head -c bytes`
# e.g. for a 1kb file:
cat /dev/random | head -c 1024 > data.bin
@catwell
Copy link

catwell commented Jun 5, 2012

More traditional (and no pipes):

dd if=/dev/urandom of=data.bin bs=1024 count=1

@deltheil
Copy link
Author

deltheil commented Jun 5, 2012

Cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment