I have read this question: How to create a file with a given size in Linux?
But I havent got answer to my question.
I want to create a file of 372.07 MB,
Change your parameters:
dd if=/dev/zero of=output.dat bs=1 count=390143672
otherwise dd
tries to create a 370MB buffer in memory.
If you want to do it more efficiently, write the 372MB part first with large-ish blocks (say 1M), then write the tail part with 1 byte blocks by using the seek
option to go to the end of the file first.
Ex:
dd if=/dev/zero of=./output.dat bs=1M count=1
dd if=/dev/zero of=./output.dat seek=1M bs=1 count=42