Create a huge file in less than a second

Here’s how to create a large file in Linux:

dd if=/dev/zero of=filename bs=1 count=1 seek=$((100*1024*1024*1024))

This creates what is called a “sparse file”. However, df will not recognize the reduction in size. From what I can tell, there is no way to get df to recognize sparse files. du and df will always disagree.


54 Words

2010-12-17 10:04 +0000