Last Updated: February 25, 2016
·
162
· jkburges

Searching, viewing and manipulating compressed files

When dealing with compressed files, do you find it tedious to first uncompress to a temporary location before searching/viewing them (for example, when looking at archived log files)?

There exists a family of commands starting with the letter 'z' which can operate directly on compressed files, e.g. zcat, zdiff and zgrep in the same way that their namesakes operate on non-compressed files.

e.g. to search for "xyz" in a compressed file:
$ zgrep xyz file.gz