16Aug/110
Create a 100Mb file in Linux
I recently needed to create a 100 Mb file to do some testing. It didn't matter what was in it, I just needed a file of that specific size.
I created it with the following command:
dd if=/dev/random of=filename bs=1024 count=102400
The options are as follows:
if = the source of the input
of = output file name
bs = in this case this sets the block size
count = the number of blocks to copy in the file
Multiply the number of blocks (count) times the size (bs) to calculate the size of the file (in bytes).