Back to the command reference

zcat

ArchivesBeginner In simulator In real Linux

Show the content of .gz files without extracting

Name: zcat = zip cat

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

zcat decompresses .gz files to standard output without writing anything to disk, ideal for reading or piping compressed logs. zgrep and zless work the same way.

Syntax

zcat FILE...

Examples

  • $ zcat app.log.gz | grep ERROR

    Search a compressed log

    Explain
  • $ zgrep ERROR app.log.gz

    Or use zgrep directly

    Explain

Related