zcat — Uncompress and display data

Format

zcat –DVv [file …]

Description

zcat takes one or more compressed data files as input. The data files should be compressed with the compress command. If no data files are specified on the command line, zcat reads standard input (stdin). You can also pass stdin to zcat by specifying as one of the files on the command line.

zcat uncompresses the data of all the input files, and writes the result on standard output (stdout). zcat concatenates the data in the same way cat does.

The names of compressed input files are expected to end in .Z. If a specified input file name does not end in this suffix, zcat automatically adds the .Z. For example, if the command line specifies file abc, zcat looks for abc.Z.

zcat is equivalent to:
uncompress -c

Options

–D
Uncompresses files that were compressed using the dictionary option of compress.
–V
Prints the version number of uncompress that zcat calls.
–v
Prints the name of each file as it is uncompressed.

Localization

zcat uses the following localization environment variables:
  • LANG
  • LC_ALL
  • 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
  • File is not in compressed format
  • File was compressed with a number of bits zcat cannot handle
  • There is no space for decompress tables
  • The compressed file is corrupt

Portability

UNIX systems

Related information

cat, compress, uncompress