Lably
Skip to content

Compress (software)

Compression shell command based on the LZW compression algorithm

  • 3 min read
  • 3 chapters

Related on Lably

Through Command (computing) and HTTP

Although once popular, compress has fallen out of favor because it uses the patented LZW algorithm. Its use has been replaced by commands such as gzip and bzip2 that use other algorithms and provide better data compression. Compared to gzip at its fastest setting, compress is slightly slower at compression, slightly faster at decompression, and has a significantly lower compression ratio. 1.8 MiB of memory is used to compress the Hutter Prize data, slightly more than gzip at its slowest setting.

compress and uncompress have maintained a presence on Unix and BSD systems and have been ported to IBM i.

compress was standardized in X/Open CAE Specification in 1994, and further in The Open Group Base Specifications, Issue 6 and 7. Linux Standard Base does not require compress.

compress is often excluded from the default installation of a Linux distribution but can be installed from a separate package. compress is available for FreeBSD, OpenBSD, MINIX, Solaris and AIX.

compress is allowed for Point-to-Point Protocol in RFC 1977 and for HTTP/1.1 in RFC 9110, though it is rarely used in modern deployments as the better deflate/gzip is available.

Use

Files compressed by compress are typically named with extension ".Z" and therefore sometimes called .Z files. The extension derives from the earlier pack program which used extension ".z".

Most tar implementations support compression by piping data through compress when given the -Z command line option.

gunzip can decompress .Z files.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in From Lably lessons