Face 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
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
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.
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
Explore more about: File Compression.