voipmeister.com voip stuff matters and more

Generate a file with a specific size

Recently, I needed a file with a specific size. On a BSD or Linux machine, such a file can easily be created. The 50 in the oneliner below means that a 50MB file will be created:

dd if=/dev/zero of=test.img bs=1024 count=0 seek=$[1024*50]