You can use fallocate command to quickly create a large file in Linux systems.
Example:
Create a large file of size 1 GB:
1 2 3 |
## Create a large file of size 1 GB ## fallocate -l fallocate -l 1G myfile.txt |
Get the file size:
1 2 3 4 |
## Get the file size ls -l --b=G myfile.txt ## or du -sh myfile.txt |
Remove the file:
1 2 |
## Remove the file rm myfile.txt |