Several open-source utilities are available to handle all your archival and zip file formatting needs on both Windows and Linux desktops and servers.
How do you commonly handle archived and zip file formats on your Windows and Linux systems? In this TechTip, I'll show you a few free and open-source utilities available to handle these tasks, plus remind you of a few native Linux system utilities.
A Little Bit of History
File compression and archival is nothing new. It dates back to the 1960s, when IBM had a utility called SQUOZE that was used to package programs. By the 1970s, file archival programs started to become mainstream and commonly came packaged as system utilities as part of the OS. The UNIX utility Tar (tape archive) is a perfect example of such a utility. Tar itself archives files, and combined with compression using Gzip or Bzip2, Tar can produce and extract compressed files commonly referred to as Tarballs.
The zip file is another format for archiving files and was invented by Phil Katz in the 1980s for a utility called PKZIP. He kept the format open, which allowed it to become the popular zip file format that we know today. These technologies and formats paved the way for many of the popular licensed and open-source utilities you can find today.
Windows Archival Tools
Two of the most common licensed non-free programs to handle archived and zipped files in Windows are WinZIP and WinRAR. Also, Windows XP comes with the ability to open and extract compressed files in the Explorer shell; however, you're very limited in options with the Windows tools. WinZIP and WinRAR are full-featured programs for handling files, but again, they're not open-source tools, and you must purchase a license after the trial period expires. Here's where a few open-source alternatives come into play.
7Zip is a file archiver that runs on both 32- and 64-bit versions of the Windows operating systems. A great feature of 7Zip is that it's supported in virtually every instance of Windows known, including 98, ME, NT, 2000, XP, and Vista. The 7Zip utility is mostly licensed under the GNU LGPL, with the exception of the unRAR code being licensed under a combination of GNU LPGL and unRAR restrictions. The details can be found under the license description.
One of the enticing features of 7Zip is its ability to support 256-bit AES encryption in zip compression format, along with its own 7Z format. It also supports packing and unpacking files in 7Z, Zip, Gzip, Bzip2, and Tar formats, and it provides the ability to unpack files from over a dozen more compression formats. 7Zip claims to provide compression ratios that are superior to those of PKZip and WinZIP utilities, ranging from 2 percent to 10 percent better compression ratios. And finally, 7Zip provides a powerful command line interface alongside its GUI interface.
7Zip is powerful enough to open and extract many Windows .exe, .msi, and cabinet files if you need to examine the contents of normally inaccessible items. Figure 1 below shows 7Zip in action after extracting the contents of an .exe file on a Windows desktop.
Figure 1: 7Zip extracted a Windows executable file to a folder. (Click images to enlarge.)
This demonstrates only the simplest of what 7Zip is capable of doing for you. Visit the 7Zip Web site to read more details and download a copy to test out and use.
PeaZip is another utility very similar to 7Z for your archival needs. It's unique in that it's a cross-platform utility that will run on Windows 9x, 2000, XP, and Vista along with being able to run on Linux. PeaZip provides Debian and RPM packages, as well as source files for installing it on any Linux flavor you like. It also supports versions 1 and 2 of the Linux GTK graphical environment. If you don't want to install any software on the Linux system, you can use the standalone version, which unpacks everything you need to run PeaZip locally from a folder, instead of installing binaries on systems.
Just like 7Zip, PeaZip supports creating and extracting files in 7Z, Gzip, Bzip2, Tar, Zip, and many more. For extraction purposes only, PeaZip supports RAR, DEB, ISO, ACE, RAR, and many more archive types. Encryption is supported using the AES 256-bit algorithm. Figure 2 shows me adding directories and files in preparation to creating an archive. You can see the creation types supported.
Figure 2: Create an archived project using PeaZip's interface.
To obtain a copy of either the Windows or Linux version of PeaZip, visit the Sourceforge Web site.
Native Linux Tools
Although graphical tools, such as built-in Gnome and KDE package viewers and PeaZip's GUI, are useful on a Linux system, chances are you can manage archived files better and faster on a command line. Almost all Linux installations already come with many of the tools that you need to handle zipped files. I've yet to come across a Linux install that didn't have Tar installed. You can use Tar to handle common .tar and .tar.gz files. To read the Tar manual, type "man tar" at the command line.
The most common programs to handle zip files are already installed as well. Check out the command "unzip" to unpack zip files and the utility "zip" to create an archive. Others include bunzip2/bzip2 and gunzip/gzip2. If you're familiar with Linux in the least, chances are you already know about all of these commands. If you're not, remember that you can read the manual of virtually every Linux command by typing "man" followed by the command you want to investigate at a command line shell.
Whether you're using archived tar and zip files to easily package and transport resources across a LAN or email or you're using them for backup purposes, chances are you touch and maintain packaged files on a daily basis. Although it might be a common task, it's still important to have the right tools available at your disposal.
There are plenty of commercially available products to assist you with creating and unpacking archived files, but if you find any of these lacking, give these open-source alternatives a try on your systems. As always, if you find an open-source project useful, consider dropping a thank-you note to the maintainers. Often, this is far more meaningful to an open-source maintainer than anything else.