What are the reasons (historical, compatibility issues ..) for the existence of gunzip despite gzip offers the same (and extended) functionality?

I checked /bin/gzip and /bin/gunzip and they are separated executables. Why not an unique executable and two symlinks?

  • 2
    I'd say it's mostly for historic reasons. Some ~25 years ago by far the most popular archiver was pkzip, and it had a pkunzip counterpart. It was followed by a flurry of other archives following the same naming scheme. In the world of commercial UNIX there was a compress and an uncompress. I think rar (or maybe arj? I can't remember) was the first major archiver that used the same executable for both operations. – lcd047 Jun 4 '15 at 16:23
  • Rahul Dhesi's zoo, from 1986, had addition and extraction in one program. – JdeBP Jun 4 '15 at 18:21
  • Interesting question. Probably the only way to find out for sure is to find the reasons through an extensive search of old Usenet articles or e-mails. I suspect that @lcd047 is correct. gzip uses the same Lempel-Ziv algorithm that pkzip used so I guess they decided that its a clone of pkzip. I never think of it as a clone of pkzip but when you read the gzip man page that connection cannot be ignored. – deltaray Jun 4 '15 at 18:51
  • Hmm, the case of zoo is interesting. It was indeed popular on BBSes and the like, but for whatever reasons I don't think it was nearly as influential al pkzip. – lcd047 Jun 4 '15 at 19:16

Historically, it was common for compressors to have symmetric decompressors, for one simple reason: when you start distributing files compressed with a new compression program, you want recipients to be able to easily decompress them. Generally speaking, when they're separate, the decompression program is simpler and smaller than the compression program, which makes it easier to transfer (think of transmission speeds and storage capacity thirty years ago), and easier to port to new systems too.

I can't find the original releases of gzip so I don't know if that applied in this particular case; the oldest version I've found, 1.2.4, released in 1993, already used a single binary for gzip and gunzip. Note that current versions still support this; gunzip is just a wrapper shell script.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.