Ok friends, after creating a large amount of files (but empty) in windows, now we can also create a empty file in linux too.
For this purpose we must a single commands and ..........
Trick : -
# dd if=/dev/zero of=filename bs=1024 count=desired
Example to create a 1GB file:
dd if=/dev/zero of=file_1GB bs=1024 count=1000
/or/
dd if=/dev/zero of=file_1GB bs=4096 count=250
/or/
dd if=/dev/zero of=file_1GB bs=2048 count=500
Example to create a 2GB file:
dd if=/dev/zero of=file_2GB bs=2048 count=1000
/or/
dd if=/dev/zero of=file_2GB bs=1024 count=2000
Example to create a 512MB file:
dd if=/dev/zero of=file_512MB bs=1024 count=500
/or/
dd if=/dev/zero of=file_1GB bs=512 count=1000
either use
# mkfile size myfile
where can be in KB, MB or GB using k, m or g as suffix. To create a 10 GB file, use
# mkfile 10240m myfile
Ifyou run # mkfile -n 10240m myfile the file will be created, but thedisk blocks will not get allocated, only when writing data into thefile.
0 comments:
Post a Comment