linux create file with size

01:52 PM by Christian Koch

Filed under Commands

Last modified Friday June 22nd, 2012

Learn fast, howto create a new file with a fixed size on the bash

To create new files on linux bash systems with a fixed size use the dd command:

dd if=/dev/zero of=youroutputfile bs=1024 count=102400

if: read from file (input file), in this example I want the file ot be filled with zero’s hence /dev/zero
of: your output file
bs: block size in kb
count: count of blocks.

So in the example above I create a 100 Mb file.

 

Related Articles

                                                          Leave a Comment