I\'ve seen some examples of grepping lines before and after, but I\'d like to ignore the middle lines. So, I\'d like the line five lines before, but nothing else. Can this b
This way is easier for me:
grep --no-group-separator -B5 "pattern" file | sed -n 1~5p
This greps 5 lines before and including the pattern, turns off the --- group separator, then prints every 5th line.