I am new to Linux and would just like to know

  • What do the gzcat and zcat command do?
  • What is the difference between them?
  • On what occasion would we use them?

It would really help if you guys could give some examples.

4 Answers 4


Take a look at man zcat

You will see that they are the same:

On some systems, zcat may be installed as gzcat to preserve the original link to compress.

And what they do, which is uncompress a compressed archive and write the entire contents to stdout ie the terminal window.

This is rarely what you want.

$ ls -l Py*
-rw-rw-r-- 1 zanna zanna 20566643 Aug 17 17:12 Python-3.5.2.tgz
$ zcat Py* > huge-file
$ wc huge-file
1859226  7277134 78458880 huge-file

However you might use it to read some old system logs that have been compressed like so:

$ sudo -i
# zcat /var/log/dpkg.log.2.gz | less

But as @Serg points out, there is also zless so this is a Useless Use of cat:

# zless /var/log/dpkg.log.2.gz

You could also redirect (>) the output to a file in these examples because it is so long. Then you could read it in your favourite text editor that allows easier scrolling and searching...

# zcat /var/log/dkpg.log.2.gz > old-dpkg-log

Otherwise, zcat leaves the original file alone and doesn't save a new file or directory, so it provides a way you can look inside an archive without creating any clutter.

You might find a good use for it in a script... :)

  • 1
    FYI, there is also zless. Some of these utilities are just shell scripts, by the way Commented Aug 17, 2016 at 16:34
  • 2
    @Serg oh no UUoC!! >_<
    – Zanna
    Commented Aug 17, 2016 at 16:38

Supplementary info:

zcat is same thing as uncompress -c, though on many systems it is actually same as gzcat and gunzip -c.

gzcat is same as gunzip -c which is gzip -dc.

man pages and available -options for:



Basically, if you have text files stores in archive files, like .gz archive or .zip file, those commands will print the textfiles without extracting them.

This is very useful for log files, since those files grow large and Linux automatically rotates them, periodically, by storing older ones into .gz archives


open a terminal and use "man zcat" and/or "man gzcat". In a short term : "gzip, gunzip, zcat - compress or expand files"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .