Operating System - HP-UX
1834127 Members
2219 Online
110064 Solutions
New Discussion

making smaller files from larger ones

 
SOLVED
Go to solution
Erik Allaert
Occasional Advisor

making smaller files from larger ones

Hola,

I have a 9Gb file that I would like to chop into <2Gb sizes, is there a command or method to do this.

Laters
5 REPLIES 5
harry d brown jr
Honored Contributor
Solution

Re: making smaller files from larger ones

yes, you can use dd.

using the options bs, skip, and count you can easily do so:

dd if=bigfile of=littleone bs=1024 count=2097152

then the next file

dd if=bigfile of=littletwo bs=1024 skip=2097152 count=2097152

.....


live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: making smaller files from larger ones

I should have added: BUT, be careful that you are getting the correct start and stop blocks correct. Make sure you don't delete your original bigfile, in case you need to adjust your numebrs.


live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: making smaller files from larger ones

And beleive it or not, here's a site covering just this:

http://www.crazytrain.com/dd.html


live free or die
harry
Live Free or Die
Thierry Poels_1
Honored Contributor

Re: making smaller files from larger ones

Hi,

how about "split"? ;-)

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
harry d brown jr
Honored Contributor

Re: making smaller files from larger ones

Thierry,

good idea, "split" with the "-b2048m" option it would make 2gb files. Good catch!

live free or die
harry
Live Free or Die