Linux uses the dd command to quickly generate large files, and the linuxdd command to generate
The dd command can easily create a specified size file, as shown in figure
Dd if =/dev/zero of = test bs = 1 M count = 1000
A m test file is generated. The file content is 0 (because it is read from/dev/zero,/dev/zero is 0)
However, the speed of writing files to the hard disk depends on the read/write speed of the hard disk. If you want to generate a large file, the speed is very slow.
In some scenarios, we only want the file system to think that a large file exists here, but it is not actually written to the hard disk.
You can
Dd if =/dev/zero of = test bs = 1 M count = 0 seek = 100000
The size of the created file is 100000 MB in the file system, but it does not actually occupy the block. Therefore, the Creation speed is equivalent to the memory speed.
The role of seek is to skip the specified size part of the output file, which achieves the goal of creating a large file but not actually writing it.
Of course, because it is not actually written to the hard disk, you can create GB of such files on a hard disk with a capacity of only 10 Gb.