Creating empty files with specific sizes

Adam K Dean - Feb 7 '14 - - Dev Community

Note from the future (Feb 3rd, 2020): just remember that DD stands for disk destroyer. Be careful using it, and never copypaste dd excerpts from the internet. Be safe.

If you're doing speed tests, you may find yourself needing large files with which to test your connection speeds and stability.

On Linux, you can do this with dd like so, creating a 100 MB file (or thereabouts):

dd if=/dev/zero of=output.png bs=1M count=100
Enter fullscreen mode Exit fullscreen mode

On Windows servers, you can do this using fsutil, like so:

fsutil file createnew output.png 104857600
Enter fullscreen mode Exit fullscreen mode

Remember, 1024 bytes in a kilobyte, 1024*1024 bytes in a megabyte, and so forth.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player