Unix/Linux — generate large file

By Rares Vernica

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

You must be logged in to post a comment.