Splitting a file into different size chunks

Nils Kassube kassube at gmx.net
Tue Mar 31 09:09:55 UTC 2009


Oliver Marshall wrote:
> I need to split a file in to pieces, but not all of the same size. I
> have a 20mb file, and I need to split the first 2MB in to one file,
> then the following 4MB in to another file, then the next 1MB in to
> another file, and discard the rest.

dd if=inputfile of=outfile1 bs=1 count=2000000
dd if=inputfile of=outfile2 bs=1 count=4000000 skip=2000000
dd if=inputfile of=outfile3 bs=1 count=1000000 skip=6000000


Nils




More information about the ubuntu-users mailing list