| Linux Apache (10) Network (11) shell (12) |
Creating a big space holding file
Question: How can I create a dummy file for test purposes in the unix shell?Answer: This creates a file 'empty.dat' of size 1 MB (1024 blocks of 1024 bytes each), all zero:dd if=/dev/zero of=empty.dat bs=1024 count=1024 This creates a file 'random.dat' of 2 MB (2048 blocks of 1 KB each), filled with random values: dd if=/dev/random of=random.dat bs=1024 count=2048 Comments:
|