Skip to main content
Welcome guest. | Register | Login | Post

GNU tar now supports LZMA compression

I was freeing up some space on my /home/ partition and tried archiving & compressing about 2GB of JPEG photos. Using either gzip or bzip2 compression barely saved any space, so I thought I should maybe try 7zip. I do not like 7zip though because it is quite un-Unixy (the same format archives & compresses, and it does not store permissions). There were three workarounds for this: 7zipping a tar archive, piping lzma's output to tar, or passing "--use-compress-program=lzma" to tar.

There is a nicer solution now though. I looked at GNU Tar's homepage to find that there was a new release, 1.20, fairly recently (2008-04-14) that added support for LZMA compression (the very good algorithm that 7zip uses). It is enabled by the --lzma option. Although there is no one-character shorthand for this, there is a new option --auto-compress, or -a, that automatically selects what compression to use based on the archive's filename. LZMA compression is invoked by ending the archive's filename in ".tar.lzma" or ".tlz" (more about --auto-compress).

GNU Tar 1.20 is currently in Fedora Rawhide. As root, run "yum update tar --en=rawhide" to update to it.