grep ??? searching a file and outputting 5 lines either side...
Hi,
Anyone tell me how I can search a file and output the following. 1 - 10 lines with the search result in the middle 2 - line numbers (if possible?) I have the grep working, simple search for a string but I would like to output the above 5 lines and the following 5 lines. Any thoughts? |
Solution
-A for trailing lines -B for leading lines -n for Line numbers EDIT - I have solved this myself - forgive me |
Quote:
|
All times are GMT -5. The time now is 12:59 AM. |