Using Linux? Here Are Your Options For File Compression

Ads by Google

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.

Ads by Google

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, 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.

Conclusion

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

Ads by Google

13 Comments - Write a Comment

Reply

ReĂ˝ Aetar

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

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

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

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

ReĂ˝ Aetar

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

Reply

Harry Fyhr

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

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

Reply

Tulitanssi

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

Danny Stieben

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

Reply

Alex Livingstone

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

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

Reply

eugen9

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

Reply

Efi Dreyshner

I am using 7zip :)

Your comment