Americas

  • United States
sandra_henrystocker
Unix Dweeb

Unix tip: 7-Zip to the rescue

Analysis
Dec 30, 20084 mins
Consumer ElectronicsData CenterOpen Source

I recently needed to install a Solaris package on a day I was working from home. I didn’t have my Solaris CDs with me nor did I know which CD of the set the particular package would be located on. And the idea of downloading and burning each of five CD images just to find and extract the package I needed seemed like a big waste of time and resources. What did I do? I googled my way to the answer to the question “Isn’t there some way I can extract just the package I need from one of the Solaris iso.tar files using my Windows XP laptop?” The answer was “Yes, there is! It’s called 7-Zip.”

7-Zip is open source, GNU LGPL-licensed software that supports a extremely wide range of file formats. You can pack and unpack 7z, zip, gzip, bzip2 and tar files. You can unpack (i.e., unpack only) arj, cab, chm, cpio, deb, dmg, hfs, iso, lzh, lzma, msi, nsis, rar, rpm, udf, wim, xar and z files. What I needed was, of course, to download the iso.zip files from Sun’s web site, unzip each of them (using 7-zip or WinZIP) and then find and extract the particular package that I needed using 7-zip. No CD burning needed. I found out that I could unzip and extract from the iso file with one running of 7-Zip. Here’s how it worked:

With 7-Zip installed on my laptop, I right clicked on the first of the Solaris iso.zip files. I then:

  • selected 7-Zip -> Open Archive to open the iso.tar file
  • double-clicked on the iso file
  • opened the Solaris_10 folder
  • opened the Product folder and
  • looked through the package folders (e.g., SUNWfbc, SUNWfchba and so on) until I found the one I needed.
  • Now that’s a handy tool! For zip and gzip files, 7-Zip’s compression ration is said to be 2-10% better than what is provided by PKZip and WinZip. It also offers AES-256 encryption for 7z and ZIP formats should you need it. 7-Zip works in Windows 98, ME, NT, 200, XP (I use XP Professional) and Vista. It was a 2007 winner in the SourceForge.net Community Choice Awards for both Best Project and Best Technical Design. I found it to be both quick and reliable. It also has localizations for 74 languages. 7-Zip also works on the command line. If you like working in a DOS Command Prompt, you can get a list of the tool’s options by simply typing its name. That output is shown below.
C:Program Files7-Zip>7z

7-Zip 4.57  Copyright (c) 1999-2007 Igor Pavlov  2007-12-06

Usage: 7z  [...]  [...]
       []


  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths

  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -v{Size}[b|k|m|g]: Create volumes
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries
You can download 7-Zip from http://www.7-zip.org/. It’s such an impressive tool that I’m surprised I wasn’t aware of it a long time ago. It will be in my standard set of desktop tools from now on.
sandra_henrystocker
Unix Dweeb

Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she's chasing the bears away from her bird feeders.

The opinions expressed in this blog are those of Sandra Henry-Stocker and do not necessarily represent those of IDG Communications, Inc., its parent, subsidiary or affiliated companies.

More from this author