Unix tip: 7-Zip to the rescue

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 Files\7-Zip>7z
    
    7-Zip 4.57  Copyright (c) 1999-2007 Igor Pavlov  2007-12-06
    
    Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
           [<@listfiles...>]
    
    <Commands>
      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
    <Switches>
      -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.
Top 10 Hot Internet of Things Startups
Join the discussion
Be the first to comment on this article. Our Commenting Policies