Unix/Linux — generate large file


In order to generate a large file of a set size you can use:

dd if=/dev/zero of=test100M.bin bs=100000000 count=1

where of is the output file and bs is its size in bytes.


One Response to “Unix/Linux — generate large file”

  1. keramida Says:

    Another neat trick using dd is to create a large file with a huge hole:

    dd if=/dev/zero of=hugefile bs=512 count=1 oseek=204800

    Some systems even have a special truncate utility:

    truncate -s 100m hugefile

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: