i around 50 .gz files in a particular directory in linux. i need to find a particular line in each file. currently i am doing by zcat each file.
zcat 20160909-custfw.log.7.gz | zgrep BGP | zgrep 184.108.40.206
Sep 9 17:12:47 220.127.116.11 cap-s12-custfw-1: NetScreen
device_id=cap-s12-custfw-1 [Root]system-information-00542: BGP peer
10.24.224.187 changed to Idle state (2016-09-09 17:13:15)
zgrep 'BGP.*18.104.22.168' $dir/*.gz?
(Or to achieve equivalent results to your sequence of two
zgrep calls, you would have to zgrep also the inverse order of the two regexes, sth like
zgrep 'BGP.*22.214.171.124\|126.96.36.199.*BGP' $dir/*.gz.)