You can use zgrep . Usage is similar to grep .
zgrep "pattern" file.gz
From the description of the man page:
Zgrep calls grep for compressed or gzipped files. All options specified are passed directly to grep. If the file is not specified, then standard input is unpacked, if necessary, and served in grep. Otherwise, these files are uncompressed, if necessary, and Grep.
source share