You don’t need to uncompress them in the first place. You can use zgrep on compressed or gzipped files.
To search in compressed file, execute the command :
root@ck [~]#zgrep ‘put-your-text-here’ /your-file-path-here/file.gzExample : I want to grep ‘plugged’ in all of my exim_paniclog archived files.
root@ck [~]# zgrep ‘plugged’ /var/log/exim_paniclog.*