Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

zcat - expand and concatenate compressed data

&pagelevel(4)&pagelevel

zcat takes files that have been compressed with compress and copies them to standard output in their original form. The compressed file remains compressed. Files compressed with compress can be restored to their original form with the uncompress command.

zcat, together with compress and uncompress, forms a group of commands used to compress and expand files and to display files in expanded form. zcat ist identical to uncompress -c.


Syntax


zcat[ file...]

file

Name of the compressed file to be output in its original form. You can name any number of files.
You may enter the name of the file with or without the .Z extension; if you omit the extension, zcat automatically searches for the appropriate .Z file.

Error

The following errors result in the failure of the zcat command.


filename: no such file or directory
The file you specified does not exist.


filename: not in compressed format
The file you specified was not compressed using compress.


filename: compressed with xxbits, can only handle yybits
The file was compressed by a program which could handle more bits than the compression code on this machine. You may be able to recompress the file with a smaller number of bits.


uncompress: corrupt input

There has been a SIGSEGV signal (addressing error due to segmentation violation). This usually means that the input file is corrupted.

Locale

The following environment variables affect the execution of zcat:

LANG

Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL

If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE

Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files), the classification of characters as upper- to lower-case, and the mapping of characters from one case to the other.

LC_MESSAGES

Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

NLSPATH

Determine the location of message catalogs for the processing of LC_MESSAGES.

Example

The file zcat_ex is printed with cat, compressed with compress, and then output again with zcat.

$ cat zcat_ex
I have still not been compressed!

$ compress -fv zcat_ex

zcat_ex: Compression: -16.12% -- replaced with zcat_ex.Z

$ zcat zcat_ex.Z

I have still not been compressed!

See also

cat, compress, uncompress