Attention B2B Marketers: Access 30 Million IT Decision Makers with a Custom Lead Generation Program Click to Learn More!
Welcome Guest | Sign In
Content Marketing on ALL EC

7-Zip Stuffs Data Tight, but It's Hard to Get a Grip on This Zipper

By Jack M. Germain LinuxInsider ECT News Network
Jun 27, 2012 5:00 AM PT

7-Zip Stuffs Data Tight, but It's Hard to Get a Grip on This Zipper

7-Zip and p7Zip belong to a family of file compression utilities that are among the best available for Linux/Unix. So you would think that the development communities would offer to Linux users what is available in similar compression apps on the Windows and Mac platforms. Think again!


It's unfortunate that such a powerful tool lacks an easy interface. What makes 7-Zip and p7Zip superior to other compression utilities is the far greater compression ratios they provide. The 7z (the native format for 7-Zip files) compression algorithm produces results that are 30 to 50 percent better than standard zip compression.

But the Linux app lacks any true graphical user interface or GUI as a front end.

That leaves 7-Zip and p7Zip technology out of reach for many Linux users. The command-line-only interface is too complex for typical Linux users to master. This is especially true for Linux newcomers familiar with easy-to-use options on Windows and Mac systems.

But despite the missing GUI, Linux users looking to try the higher file-packing ratios of 7-Zip and P7Zip have two options to help them avoid the starkness of issuing terminal commands in a black void. But both of these options underscore the difficulty of using 7-Zip and p7Zip in Linux.

Not for the Choosy

First of all, not every computer user needs a compression utility. Greater Internet bandwidth and more external options for storing large files eliminate the need to crunch files into compressed formats.

Even if you do need a compression tool to save a large set of files into one wrapped-up package, easier solutions exist in Linux. For instance, nearly every Linux distro comes with a default file compression utility that has some semblance of a GUI.

One of the more popular is the File Archiver app called File Roller on the GNOME desktop. It also works with newer GNOME-based shells such as Cinnamon. But these alternatives provide much smaller compression ratios compared to the output from the 7-Zip family.

Family History

7-Zip is designed to handle a large collection of compression formats. The default format is .7z. This format is related to the older LZ77 compression algorithm. The compression algorithm built into it is LZMA, or Lemple-Ziv-Markov, algorithm.

The application in its Linux form is related to another command-line client package called "p7zip." This second version provides two executables, 7z and 7za. Both branches use the same syntax and options.

P7zip is ported from 7-Zip. 7-Zip is available for a variety of platforms, some offering GUIs. But not in Linux. P7zip is the command-line version of 7-Zip strictly for Unix/Linux users. It was created by a different developer. Both use the new 7z format.

With 7-Zip installed on your system, a plugin adds it to the library of file-compression options available in File Roller. This arrangement at least makes using 7-Zip a bit more convenient.

Starting Point

The 7-Zip and p7Zip Linux packages are readily available in most distros' package management systems. So installing either one is much easier than downloading a compressed file and manually installing the files.

But without a GUI, there is no desktop menu integration. So you will not find any listing for either app in your desktop menus. Using these two apps is strictly by fingertip interface.

Taking Command

I do not like issuing cryptic commands in a terminal window. So even clumsy workarounds are a better option for me. Unless you have pressing needs for the tighter compression results 7-Zip and p7Zip deliver, using either one is less inviting. The 7-Zip commands are sometimes confusing.

Typical for Linux applications, especially those with no GUI, the lack of documentation adds to the user dilemma. But if you put some effort into using the -h command after the app name and scouring the Internet for command instructions, you can get some impressive results.

I found that extracting files from a 7Z archive is considerably easier than "zipping" files into an archive. If for no other reason, the command-line structure requires fewer options.

For example, uncompress an archive using this format: 7z x myfile.7z . The e function extracts all files to the current working directory. The x function preserves their paths.

Alternative Access

I found an unusual solution on the Internet that introduced me to the advantages of the 7-Zip app. Go here to use a form to generate the 7z commands. Lonnie Lee Best created a Simple 7-Zip Command Generator that makes learning the CLI (command line instruction) process a lot less intimidating.

Use the form to create the needed 7z commands. Then copy them directly into your terminal at the command prompt. His form does not include all of the range of commands available in 7-Zip. But he provides enough to give you a good head start.

The form asks you basic questions about your file compression task. You enter the information. The needed commands are generated at the bottom of the form.

For example, you tell the form generator where the folder or file is that you want to archive. (example: /home/user/Desktop/FolderName)

Next, enter into the form the folder you want the output file(s) to be placed. (example: /home/user/Desktop)

Third, tell what you like to name the output file(s) and what level of compression you want and whether to divide the output into multiple volumes.

Finally, when you have answered all the questions on the form, click the button to generate your command. Remember to copy and paste the results into an open terminal window to perform the file compression.

Mind Your Ps and Qs

I did find a partial front end for 7-Zip called "Q7Z." It is not a full GUI solution for the Linux 7-Zip app. But it does help automate the process, especially for creating compressed 7z files. But the setup may be just as demanding.

Get the Autopackage file here. Get ready to roll up your sleeves. A few detailed setup procedures are needed before you can use this workaround. And yes, you will have to open a terminal window to do these steps after the download is finished.

  • Step one: Change to the directory holding the Autopackage File.
  • Step Two: Give the file you downloaded executable permissions. Use this command to do this:

    chmod u+x q7z-XXX-package (Replace the XXX with the actual release number listed in the downloaded file's name)

  • Step Three: Enter this command:

    sudo ./q7z-XXX-package (Again, replace the XXX with the release number as you did in Step Two)

Finishing Up

If all goes as instructed, you will see activity fill the terminal window. The installer will ask you a series of questions that seek your permission to get and install several components and missing dependencies.

Once that process completes, the Autopackage installer completes the procedure by running the full install process.

When all activity in the terminal window ends, your work is done. Now you can actually use Q7Z to control the 7-Zip file compression app. Start it with this command in the terminal window: Q7Z.pyw.

Bottom Line

The Command Line Interface for 7-Zip and p7Zip make these file compression apps less than appealing to use. But if you want the maximum file-crunching results they provide, you will have to learn to deal with the inconvenience that comes with not having a bona fide GUI. The online Command Generator or the Q7Z partial front end offer some relief.

If you work often with archiving files, either of these two CLI apps can give you excellent results. The more you use them, the easier the command line instructions will become.

Jack M. Germain has been writing about computer technology since the early days of the Apple II and the PC. He still has his original IBM PC-Jr and a few other legacy DOS and Windows boxes. He left shareware programs behind for the open source world of the Linux desktop. He runs several versions of Windows and Linux OSes and often cannot decide whether to grab his tablet, netbook or Android smartphone instead of using his desktop or laptop gear.

Facebook Twitter LinkedIn Google+ RSS
How do you feel about accidents that occur when self-driving vehicles are being tested?
Self-driving vehicles should be banned -- one death is one too many.
Autonomous vehicles could save thousands of lives -- the tests should continue.
Companies with bad safety records should have to stop testing.
Accidents happen -- we should investigate and learn from them.
The tests are pointless -- most people will never trust software and sensors.
Most injuries and fatalities in self-driving auto tests are due to human error.