Create test files of specific size

Sometimes you need file of an exact site for testing purpose like an email attachment.

Here is how you make them in Linux command line:

dd if=/dev/zero of=file_5Mb.txt bs=1k count=5120
dd if=/dev/zero of=file_7Mb.txt bs=1k count=7168
dd if=/dev/zero of=file_8Mb.txt bs=1k count=8192
dd if=/dev/zero of=file_8.8Mb.txt bs=1k count=9011
dd if=/dev/zero of=file_9Mb.txt bs=1k count=9216

This is the result:

ls ./file_* -lah
-rw-r--r-- 1 rob disk 5,0M feb 20 14:30 ./Desktop/file_5Mb.txt
-rw-r--r-- 1 rob disk 7,0M feb 20 15:00 ./Desktop/file_7Mb.txt
-rw-r--r-- 1 rob disk 8,8M feb 20 14:55 ./Desktop/file_8.8Mb.txt
-rw-r--r-- 1 rob disk 8,0M feb 20 15:01 ./Desktop/file_8Mb.txt
-rw-r--r-- 1 rob disk 9,0M feb 20 14:42 ./Desktop/file_9Mb.txt

Post new comment
The content of this field is kept private and will not be shown publicly.
CAPTCHA
Deze vraag is om te controleren of u een persoon bent. Di is om spam berichten tegen te gaan.