Creating Files of a desired Size Linux


Suppose you doing some testing on the filesystem, say about quota etc, and you need to create files of a desired size, the golden command to be used is "dd".

Check out the usage as below:

$ dd if=/dev/zero of=bigfile bs=1024 count=1048576
This will create a file of size 1024 * 1048576 bytes (or 1 GB). In this command

if - input file
of - output file or the file to be created
bs - block size in bytes
count - # of blocks of size bs

Thats all for this day.



Popular Posts