Main Menu

Search

LINUX: FOR LOOP DD COPY COMMAND TO WRITE FILES IN A LOOP

Below is the command to use.

for i in {1..2000}; do dd if=/dev/zero of=/tmp/disk-$i.img bs=1M count=10; done

With above command 2000 files will be written under /tmp directory with filenames disk-1.img, disk-2.img ... till disk-2000.img. Each file size will be 10 MB. Change number of 2000 in above command as needed to number to want (depending on how many files you want to create). Likewise you can change count value as well to higher value if you want to create larger individual file sizes (larger than 10 MB).

 


Products to which Article Applies

All Linux Operating Systems

Search Keywords: Linux dd command commands copy copies copied write writing dev zero for loop while disk disks

Article Author: Tarun Boyella

 

No comments:

Post a Comment