Tuesday, August 11, 2009

How to create a large file in Ubuntu

Use the dd command

Here is the syntax of the dd command to create the file.
I will fill the file with NULL characters.
dd if=/dev/zero of=test.tst bs=1k count=4700000
if = input file
of = output file
bs = block size
count = file size in kb
the file size is given by multiplying bs and count

Example create a 1 GB file:
dd if=/dev/zero of=file_1GB.txt bs=1m count=1k

No comments:

Post a Comment