zcat Command Examples in Linux

The zcat command dumps uncompressed data from a .gz file to stdout without recreating the original file. The .gz file remains intact.

Syntax:

$ zcat [options] [files]

Example:

$ ls
test.gz
$ zcat test.gz
A test file
# file test contains a line "A test file"
$ ls
test.gz

zcat Command Examples

1. To read zipped file:

# zcat text.gz

2. To see compressed file stats:

# zcat -l

3. To get the software lisence:

# zcat -L

4. To see the version of the zcat:

# zcat -V

zcat reads one or more files that have been compressed with gzip or compress and write them to standard output. Read standard input if no files are specified or if – is specified as one of the files; end input with EOF. zcat is identical to gunzip -c and takes the options described for gzip/gunzip.

Related Post