7-zip has one of the best compression ratio / decompression speed ratios of the planet. Give it a try, compression ratio is a bit better than RAR, and decompression is faster. The linux port is p7zip.
Unfortunately you cannot use 7zip for streams like gzip or bzip2. 7zip uses LZMA as the compression routine, and it is possible to use just this high end compressor to get the best of both worlds.
This is how to get it:
- Download LZMA SDK from here.
- Extract it:
mkdir lzma cd lzma tar xjvf ../lzma443.tar.bz2
- Compile LZMA_Alone:
cd C/7zip/Compress/LZMA_Alone make -f makefile.gcc
You get a lot of warning, just ignore them.
- If compilation was successful, copy lzma somewhere into your path:
sudo cp lzma /usr/local/bin/
Now you are ready to compress/decompress stuff. Here are some examples, when compressing the folder gimp:
- Fast compression:
tar -cv gimp |lzma e -a0 -d15 -fb16 -mfhc4 -si -so >gimp.tar.lzma
- Normal compression:
tar -cv gimp |lzma e -d21 -fb32 -si -so >gimp.tar.lzma
- Maximum compression:
tar -cv gimp |lzma e -si -so >gimp.tar.lzma
- Ultra compression:
tar -cv gimp |lzma e -d25 -si -so >gimp.tar.lzma
And finally, this is how to extract gimp.tar.lzma:
cat gimp.tar.lzma | lzma d -si -so | tar xv
Have fun!
i searched tar command that with lzma compress method.
your post is a help to me
thankyou!
i did that tricks but it’s error like this “lzma: invalid option — ‘s’
what sould i do??
I used the following in natty: “tar -cv gimp |lzma -9 >gimp.tar.lzma” note there’s also an alias “–best”. For more info see “man lzma”.
uncompressing can be done with a more memorable command line as well:
tar -xvf –lzma gimp.tar.lzma
err i meant:
tar –-lzma -xvf gimp.tar.lzma
also: –lzma needs to be set before -xvf