uncompress — Undo Lempel-Ziv compression of a file

Format

uncompress [cDfVv [file]]

Description

uncompress expands compressed data written by the Lempel-Ziv compression program compress. Data is read from file or the standard input. On UNIX systems, the name of the file to be uncompressed must end with .Z. If it doesn't, uncompress adds one before looking for the file. It places the uncompressed output in a file with the same name but without the .Z extension. If this file already exists, uncompress asks if you want to overwrite it, unless you specify the –f option.

Since the number of bits of compression is encoded in the compressed data, uncompress automatically uses the correct number of bits. This includes the 9–14 bit compression range specified by POSIX.

Options

–c
Writes uncompressed output to the standard output (like zcat).
–D
Must be used to uncompress a sorted dictionary file compressed using the –D option of compress.
–f
Forces file to be uncompressed, regardless of whether a file with the same base name already exists.
–V
Prints version number information for uncompress.
–v
Displays name of each file when it is uncompressed.

Localization

uncompress uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_CTYPE
  • LC_MESSAGES
  • NLSPATH

See Localization for more information.

Exit values

0
Successful completion
1
Failure due to any of the following:
  • Unknown command-line option
  • Inability to obtain information about an argument file
  • File has more than one link
  • File is not a regular file
  • File is not in compressed format
  • File was compressed using more than 16 bits
  • There is no space for decompress tables
  • A compressed file is corrupt

Portability

uncompress is found on many UNIX systems.

The –D option is an extension to traditional implementations of uncompress; the –D and –V options are extensions to the POSIX standard.

Related information

compress, cpio, pack, unpack, zcat