Saturday, July 12, 2008

Printing the context of a matching line in grep

You can use grep to print context of matching lines as follows

ggrep -A 4 -B 5 -f uniq.txt outapr.* > qasim.txt

this will print 4 lines above matching line and 5 lines below matching line.

Sphere: Related Content

0 comments: