Inverted Reality

« Back to blog

creating a bogus / empty file in Linux

Media_httpwwwinverted_jrndg
A friend emailed me tonight asking how he could create a file on his Linux system of a specific size, but with no real data in it... He could have googled... but. Here's a run down: dd if=/dev/zero of=somefile bs=1024 count=1048576 dd - the command if - input file (zero in this case) of - output file bs - byte size count - times So the above is a 1GB file filled with randomness.

Posted July 17, 2009