Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to compress a 16GB folder, but what's the best method? tar.gz? tar.bz2 rar? 7z? Would the archive be smaller if I first compressed in a method, then copy the compressed archive to a new folder, then re-compressed in some other method? I need to make it fit on a DVD (output maybe 8.5GB, don't remember) but putting "4370 MB" makes the compressed file be 2.5GB part.

BTW, what's the default compression method on Ubuntu?

Thanks in advance.

share|improve this question

2 Answers 2

up vote 10 down vote accepted

The default is gz. The best results I get with 7z though.

Here is the results for a 1.4 Gb virtualbox container:

enter image description here

Best compression – size in MB:

7z 493
rar 523
bz2 592
lzh 607
gz 614
Z 614
zip 614
.arj 615
lzo 737
zoo 890

Source

enter image description here

Install

 sudo apt-get install p7zip-full
share|improve this answer
    
Thanks, I already installed 7z and rar via Software Center. I'll give a try with 7z. –  Amanda Jan 5 '13 at 16:32
    
Where do these results come from? For every algorithm, the compression ratio and speed depend very much on what you are trying to compress. Try compressing some data coming from /dev/urandom: you'll get different results in each try. Or try /dev/zero: bzip2 is the winner (for the ratio). –  Andrea Corbellini Jan 5 '13 at 16:46
    
@AndreaCorbellini the link is in the answer so click it!? and like I said: it's based on a 1.4 virtualbox container. I agree that compression depends a lot on what files it are but from a few years of experience 7z seems to be better for the files I tend to have(mostly software and binary data files) –  Rinzwind Jan 5 '13 at 18:00
1  
@Rinzwind: I'm really sorry, I didn't see the Source link. –  Andrea Corbellini Jan 5 '13 at 18:06
    
@AndreaCorbellini it's ok ;) let's hope amanda reports back the results :+ –  Rinzwind Jan 5 '13 at 18:10

This question is very old, but perhaps somebody finds this solution useful:

Use rzip, after tar. It first compresses 900 MB large data blocks using a dictionary method, and then it hands the cleaned-up data over to bzip2. It is much faster than the other strong compression tools (bzip2, lzma), and some files it compresses even better than bzip2 or lzma.

Yes, gz is the default compression tool on Linux. It is fast, and despite its age it gives still very good results in compressing text files like source code. Another standard tool is bzip2, though it is much slower.

share|improve this answer

Your Answer

 
discard

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.