Files
uncompress
Decompress .Z files created by compress.
compressdecompress.Zlzwarchive
Additional Notes
uncompress restores files compressed with the historical compress command, which uses the LZW (Lempel-Ziv-Welch) compression algorithm. Input files have a .Z extension. When decompressing, the .Z suffix is removed unless the -f flag forces overwrite without prompt.
The compress format was widely used on early Unix systems. It has been largely replaced by gzip (.gz), bzip2 (.bz2), and xz (.xz), which offer better compression ratios. The .Z format is still encountered in legacy software distributions and historical Unix archives.
Syntax
uncompress [options] file[.Z]...
Parameters
file: Compressed file to decompress. The.Zextension is assumed if omitted.
Common Options
-f,--force: Decompress even if the output file already exists (no prompt).-c,--stdout: Write decompressed data to standard output, keeping the original file.-v,--verbose: Show the decompression ratio and file names.-r,--recursive: Decompress files in directories recursively.
Examples
uncompress file.Z
Decompress file.Z, producing file.
uncompress -c file.Z > output
Decompress to standard output.
uncompress -v archive.Z
Decompress verbosely, showing the compression ratio.
Practical Notes
gunzipcan also decompress.Zfiles, butgzipis more widely available.- The
compressformat is covered by old LZW patents which have since expired. zcatis equivalent touncompress -cand can read.Zfiles.- For compatibility, use
gunziporzcatsince they handle both.Zand.gzformats.