Page 1 of 1

Command to create a file of XMB

Posted: Mon Jul 02, 2012 9:57 am
by gautham
How to create a file of 10MB.
dd if=/dev/zero of=testfile_10MB bs=10485760 count=1
du -sch testfile_10MB
Note : The size might get increased to 11MB
10485760 in the above exzmple is in Byte
2 MB -- > 2097152
5 MB --> 5242880
20 MB --> 20971520
50 MB --> 52428800

Re: Command to create a file of XMB

Posted: Mon Jul 02, 2012 10:19 am
by a24uall
Another useful command :
Create a 4MB file
seq 10 600000 >> file1.txt
Other examples are
seq 100 600000 >> file1.txt >>> 8MB
seq 1000 600000 >> file1.txt >>> 12MB
seq 10000 600000 >> file1.txt >>> 16MB