boywijnmaalen
2/6/2019 - 8:30 AM

Search *.gz files for a string with lines before and after each occurence

# cd into the right directory
$ find . -name \*.gz -print0 | xargs -0 zgrep -B 35 -A 35 "Search for string"

# -A  show number of lines after an occurence 
# -B  show number of lines before an occurence