Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
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. – whitequark Aug 22 '10 at 10:25
@whitequark Just because its closed source does NOT mean that its bad. In some cases open source is a worse option. – TheLQ Aug 22 '10 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. – whitequark Aug 22 '10 at 15:20
I am sorry did the op ask for open source? I didn't see that. Off your high horse sir. – MrStatic Aug 22 '10 at 17:08

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.