Archive

Aims to be a consistent GNU-like wrapper script around various archivers, with unarchiving as a priority (over archiving, which isn't available for all archive formats).

usage: pyunarc.py [options] file ...

options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -v, --verbose         be verbose with output
  -c, --stdout          unarchive to standard out
  -d DIR, --destdir=DIR
                        unarchive to DIR
  -f, --flat            unarchive flat (files only, no dirs)
  -l, --list            list contents of the archive
  -s, --stats           show stats on available archive programs
  -r, --rar             force usage of 'rar'
  -z, --zip             force usage of 'zip'
  -g, --gzip            force usage of 'gzip'
  -t, --tar             force usage of 'tar'
  -7, --7zip            force usage of '7zip'
  -a, --ace             force usage of 'ace'
  -b, --bzip2           force usage of 'bzip2'

According to the gentoo /etc/DIR_COLORS file, and verification through apt-cache in debian SID (w/ non-free sources), the following archiving/unarchiving programs are available on GNU/Linux:

  • compress/uncompress
  • zip/unzip
  • rar/unrar
  • ace (unace)
  • 7za
  • gzip/tar.gz
  • bzip2/tar.bz2
  • lha
  • zoo
  • rzip
  • cpio

Archiver info

extension program executable license debian pkg
.z, .Z Compress uncompress Public Domain ncompress
.z, .Z GNUzip gzip -d GPL gzip
.gz GNUzip gzip -d GPL gzip
.tar(.*) GNUtar tar (-xf) GPL tar
.bz2 bzip2 bzip2 -d BSD-like bzip2
.zip Info-ZIP unzip BSD-like unzip
.ace WinAce unace Freeware (no source) unace
.7z 7-zip 7z, 7za GPL p7zip
.lzh lha(?) lha ? lha
.zoo(?) zoo zoo Public Domain zoo
? rzip rzip GPL rzip

Some interesting points :

  • zoo was written in 1988 with "Microsoft C 3.0"
  • rzip was written by Andrew Trdigell (author of rsync, co-lead on samba, and of bitkeeper controversy fame)
  • lzh and compress (and many old compression programs) use Lempel-Ziv algorithm, whose patent famously expired (unencumbering GIF and many other LZW based compression formats)
  • Bzip2 author Julian Sward also wrote Valgrind