World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0000205779
Reproduction Date:

Title: Compress  
Author: World Heritage Encyclopedia
Language: English
Subject: Bzip2, Gzip, PeaZip, PKZIP, EGG (file format)
Collection: Data Compression Software, Standard Unix Programs, Unix Archivers and Compression-Related Utilities, Unix Sus2008 Utilities
Publisher: World Heritage Encyclopedia


Filename extension .Z
Internet media type application/x-compress
Developed by Spencer Thomas
Type of format data compression

Compress is a Unix shell compression program based on the LZW compression algorithm.[1] Compared to more modern compression utilities such as gzip and bzip2, compress performs faster and with less memory usage, at the cost of a significantly lower compression ratio.

The uncompress utility will restore files to their original state after they have been compressed using the compress utility. If no files are specified, the standard input will be uncompressed to the standard output.


  • Description of program 1
  • History 2
  • Usage 3
  • See also 4
  • External links 5
  • References 6

Description of program

Files compressed by compress are typically given the extension ".Z" (modeled after the earlier pack program, that used the extension ".z"). Most tar programs will pipe their data through compress when given the command line option "-Z". (The tar program in its own does not compress; it just stores multiple files within one tape archive file.)

Files can be returned to their original state using uncompress. The usual action of uncompress is not merely to create an uncompressed copy of the file, but also to restore the timestamp and other attributes of the compressed file.

For files produced by compress on other systems, uncompress supports 9- to 16-bit compression.


The LZW algorithm used in compress was patented by Sperry Research Center in 1983. Terry Welch published an IEEE article on the algorithm in 1984,[2] but failed to note that he had applied for a patent on the algorithm. Spencer Thomas of the University of Utah took this article and implemented compress in 1984, without realizing that a patent was pending on the LZW algorithm. The GIF image format also incorporated LZW compression in this way, and Unisys later claimed royalties on implementations of GIF. Joseph M. Orost led the team and worked with Thomas et al. to create the 'final' (4.0) version of compress and published it as free software to the 'net.sources' USENET group in 1985. U.S. Patent 4,558,302 was granted in 1985, and this is why compress could not be used without paying royalties to Sperry Research, which was eventually merged into Unisys. compress has fallen out of favor in particular user-groups because it makes use of the LZW algorithm, which was covered by a Unisys patent — because of this, gzip and bzip2 increased in popularity on Linux-based operating systems due to their alternative algorithms, along with better file compression. compress has, however, maintained a presence on Unix and BSD systems. The US LZW patent expired in 2003, so it is now in the public domain in the United States. All patents on the LZW worldwide have also expired (see Graphics Interchange Format#Unisys and LZW patent enforcement).


Command-line parameters to compress are specified like this:

compress switches files

Some of the switches that can modify the output are

  • -c: Redirect output to stdout. This is default if compress is reading from stdin.
  • -d: Decompress compressed files. In most systems, uncompress is an alias for compress -d.
  • -f: If given, compress will not prompt for overwriting files.
  • -v: List all files as they are being (de)compressed.

See also

External links

  • : compress data – Commands & Utilities Reference, The Single UNIX® Specification, Issue 7 from The Open Group
  • ncompress - public domain compress/uncompress implementation for POSIX systems
  • compress - original Unix compress (in a compress'd archive)
  • compress - original Unix compress executable (gzip'd)
  • Source Code for compress v4.0 (gzip'd sharchive)
  • ZIP File containing a Windows port of the compress utility
  • source code to the current version of fcompress.c from compress


  1. ^ Frysinger, Mike. "ncompress: a public domain project". Retrieved 2014-07-30. Compress is a fast, simple LZW file compressor. Compress does not have the highest compression rate, but it is one of the fastest programs to compress data. Compress is the defacto standard in the UNIX community for compressing files. 
  2. ^ Welch, Terry A., "A technique for high performance data compression", IEEE Computer, 17(6), pp.8-19, June 1984.
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.