2

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?

3 Answers 3

4

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.

0

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.

4
  • Rar is not an open source format, has only proprietary tools to work with on Ubuntu, is not installed by default and thus would probably require administrative access. Even stupid tar|split is a better option.
    – Catherine
    Commented Aug 22, 2010 at 10:25
  • 1
    @whitequark Just because its closed source does NOT mean that its bad. In some cases open source is a worse option.
    – TheLQ
    Commented Aug 22, 2010 at 14:06
  • @Lord.Quackstar Yes. But in this particular case it is worse: there are plenty of good open-source compressors (7-Zip at least), and support for Linux version of rar is actually pretty bad.
    – Catherine
    Commented Aug 22, 2010 at 15:20
  • 1
    I am sorry did the op ask for open source? I didn't see that. Off your high horse sir. Commented Aug 22, 2010 at 17:08
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .