Create an empty file of a specific size

by: Moshe Brevda

Recently, I wanted to run a quick test to see the download speed of a web host. All I wanted was to download a file, any file really, but I wanted something 1gb in size. Moving to the www root, here is what I did:

dd if=/dev/zero of=file\_to-create bs=1k count=1000000  

This instantly gave me a 1gb file which I was then able to download!