Using Linux? Here Are Your Options For File Compression

Danny Stieben 06-08-2012

linux file compressionFace it, we have a lot of stuff on our hard drives. While some of us still have plenty of free space left thanks to the ever-expanding size of new hard drives, others have all sorts of data which quickly takes up most of their space. Wherever possible, those people would probably like to be able to compress their data to regain as much free space as possible.


Under Windows, you can compress your data with the file system itself (which can be recognized by the blue file name), but under Linux, ext4 – the default file system for almost all distributions – is not capable of file compression. Don’t worry though, there’s plenty of other ways you can compress your files under Linux – quickly and easily.

Different File Types

linux file compression

Whenever Windows users use the file system to compress their data, they’ll most likely create a .zip file. While this is the most recognized way throughout all operating systems to both compress your data and consolidate all selected files into one package, it certainly isn’t the only way for Linux users to achieve the same thing. There are also .gzip, .z, .lzma, .7z, and .rar files in addition to .zip which you can use. All of these work the same way, but they differ not only in name but in their compression algorithm. Some may be better at compressing some types of files, while some are better at others.

Experienced Linux users might ask about .tar files – these are actually not compressed, but are more commonly known to just package other files together. You’ll often find one or more of the other types of files inside a .tar file, as compressing a file which is already compressed is pretty unhelpful. The file extensions of these files are usually .tar.x, where x is a file type from the previous list.

It should be noted, however, that most distributions will already come with all necessary packages to read and create most of these file types, but any unreadable file types should become readable after a quick search in your respective package manager.


Easy Graphical Tools

linux file compression

To achieve compression on any system, you can use the appropriate command line tools to achieve what you want. However, Gnome desktops (and I assume KDE as well) have easy ways to do this graphically. In Gnome, simply right click on the file(s) or folder(s) you’d like to compress, right-click on them, and then choose Compress. You’ll then be asked for the desired name, file type, save location, and password of the compressed result of your selection. It’s quite impressive because of the available options despite the prompt’s overall simplicity.

The Future in Compression

As I mentioned before in my ext4 vs. btrfs article Ext4 vs. Btrfs: Which Linux File System Should You Use? Not sure which Linux file system to choose? These days, the smart choice is btrfs versus ext4... but which one should YOU use? Read More , support for compression within the file system is currently planned for btrfs. For now ext4 is unable to compress data by itself, and requires other programs to do it instead and bundle them in special files. Btrfs will be able to do file compression, both individually as well as for the entire partition, so you should be able to get the most out of your disk space seamlessly. When btrfs is finally used widely, it should be as simple as going into the file’s, folder’s, or partition’s properties and enable compression.


While compression on Linux may not be in the most optimal state right now, there are still plenty of options which should be good enough for plenty of people. Plus with the future stable release of btrfs, you’ll be able to use file system compression in a seamless manner. In any case, you should be able to get the most possible free space with little issues.


Do you compress your files? What is missing when it comes to compression under Linux? What’s your favorite method? Let us know in the comments!

Image Credit: Highlighted Folder Icon via Shutterstock

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Efi Dreyshner
    August 17, 2012 at 4:47 pm

    I am using 7zip :)

  2. eugen9
    August 15, 2012 at 10:08 am

    i use gzip and peazip for linux and both work fine,i use for usb sticks and emails

  3. Alex Livingstone
    August 7, 2012 at 9:30 pm

    Good to know, I dont use Linux much but the more I can learn about it the better. Compressing files/folders is a must when you have so much data.

    • Danny Stieben
      August 14, 2012 at 7:51 am

      Very true, although I find a good clean-up spree pretty helpful too. :)

  4. Tulitanssi
    August 7, 2012 at 7:07 pm

    I compress my folders selectively. Compression is great especially on SSD disk, because currently large SSD disks are still quite expensive.

    • Danny Stieben
      August 14, 2012 at 7:50 am

      Are there any specific folders you compress that you can tell everyone else about? :)

  5. Harry Fyhr
    August 7, 2012 at 12:49 am

    I'm a Windows user, but I guess my comment still has some relevance. No, I normally wouldn't compress volumes or folders, for the following reason: The files of any significant size tend to be multimedia files like JPG, MP3, misc. movie formats, and a few other things with one important thing in common: The file format is already compressed so that further compression would make very little difference. If I do have larger files that could be compressed to any significant extent, I would compress them individually, using 7-zip or a similar utility.

    • Danny Stieben
      August 14, 2012 at 7:30 am

      Compressing them individually? That's something I haven't heard many people do...interesting! But your argument makes sense.

  6. Reý Aetar
    August 6, 2012 at 6:18 pm

    no i dont compress files earlier i used to use zip folders for sending files but now i use torrent instead and compressing takes a lot of time

    • Micheas
      August 9, 2012 at 7:43 am

      gzip works faster than a spinning hard disk can retrieve data on most systems.

      zip is much slower, but has more features than gzip.

      rar is very slow to create files and while it is better than gzip it tends to only reduce the filesize a very small amount compared to gzip, for a many order of magnitude increase in time. 7z and most other compression schemes are minimally worth it in most cases when compared to gzip.

      • Danny Stieben
        August 14, 2012 at 7:22 am

        I honestly haven't taken the time to figure out which format is the best at compression. I believe I heard that it depends on what you're trying to compress.

    • Danny Stieben
      August 14, 2012 at 7:26 am

      I still use zip folders for good ol' emails. Haven't had a need for torrents yet.

      • Reý Aetar
        August 14, 2012 at 8:15 am

        dont have any idea about which compresses more but yes rar is better