SUMMARY: grep with a window

From: Mike Demarco <>
Date: Wed Jan 22 2003 - 10:15:53 EST
Many great responses 

Thanks to all:

Original question:

I seem to remember a version of grep that would give you the matching line
plus a specified number of lines before and after.

Drawing a blank as to where I have seen this though.

Any Ideas?



GNU grep has -B (before) & -A (after) to specify the number of extra lines
you want to include.

GNU grep supports the option "-C linesbefore,linesafter"

Others responded with grep -n, but that only gives the line number.

Thanks to all especially GNU

sunmanagers mailing list
Received on Wed Jan 22 10:19:56 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:02 EST