[BASH] Create big file (custom) size

This create a 15Mb file. For any use.

dd if=/dev/random of=BigFile.dat bs=1500000 count=10

Here a loop that generate 10 files of 15MB size.

$ cat MakeBigFile.sh
#!/bin/sh
for i in {1..10}
do
fName="BigFile0$i.dat"

dd if=/dev/random of=$fName bs=1500000 count=10
mv $fName ~/Dropbox/Public/BigFiles/$fName
done

$ ls -lh ~/Dropbox/Public/BigFiles/
total 293040
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile01.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile010.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile02.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile03.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile04.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile05.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile06.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile07.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile08.dat
-rw-r--r--  1 albertop  staff    14M 25 Set 12:38 BigFile09.dat
$

yep!

albertopasca.it

 

Alberto Pasca

Software engineer @ Pirelli & C. S.p.A. with a strong passion for mobile  development, security, and connected things.