Skip to content
SumGuy's Ramblings
Go back

Archive & Compression utilities

Compression types and utils in Linux

There are many compression utilities available to the average users on a linux system, so which one is best? well it all depends on what your intended use/goal for the file(s) is. Are you planning on sending the file to other OS’s? are you planning on decompressing the file on a new system where you might not have the same tools available? etc etc. I am writing about some of the ones I have used, and since this is from my usage some of it may not be entirely true and I may have dreamed up during my hallucinatory state while attending classes.

Zip

The Most popular tool, archives and provides basic compression. Works on most OS’s popularly used today.

Tar

Archive only, no compression applied by default. usually found with .tar extension

Rar

Proprietary but with support for almost all popular platforms, decent compression + archival. usually found with .rar extension

Bzip2

What many people switch to once they learn of it. Compression only so singular file at a time, very good compression, use in conjunction with tar in order to get multiple files into one tarball. use the -j flag in gnu tar to provide bzip2 support. usually found with .bz2 extension.

Gzip

Comes integrated into gnu tar by default with the -z switch, pretty good compression. all gnu systems should be default have support for it I believe. usually found with .gz extension, if used by itself, .tar.gz, .tar.gzip or just .gz if used with tar.

lzma

great compression potential, can be used byitself or with tar using the –lzma switch

xz

uses lzma2 as its compression and provides the xz container for archival. single file only. best compression out of all the tools mentioned here in my opinion. tested on a 1091MB text file using -9 compression and it brought it down to 106MB. If your system has xz utils installed then using the -J / –lzma / –xz switch will pass thru xz instead of lzma itself.

My pick is xz as of last month when I started using it for practically all my compression needs. best results out of all of the above for me. let me know if anyone has any questions.

This post is mostly from memory/conjecture and some from man pages,  so if there are any errors please let me know and I will fix 🙂


Share this post on:

Previous Post
Directory FileCount
Next Post
Sed 101