I have a folder with about 1 gig worth of images I have to upload to a server.
I want to zip/tar them up, preferably into multiple files that I can upload to my ubuntu server.
Then I want to unzip/untar them.
What's the best way to do this?
I wouldn't compress a folder containing images unless they're stored in an uncompressed format (hope it's not the case); however use:
tar -c ~/directory/ | gzip | split -d -a 3 -b 100M - out_
to zip and split ~/directory/
in out_000
, out_001
, ... each one 100MB big (adjust the -a
parameter to change the prefix length to your needs). And:
cat out_* | gunzip | tar -x
to restore the directory.
If you just want to split/un-split the directory simply remove the commands gzip
and gunzip
from the pipelines.
I would suggest raring them. Ubuntu has a few packages that can handle them and it seems to handle breaking up the archive the best.
tar|split
is a better option.
Commented
Aug 22, 2010 at 10:25
Another option would be to use tar and 7zip on them. In some cases 7zip can provide better compression that rar and is also free software.