Linux search for word and show entire line
- By Preneesh AV --
- 06-Nov-2018 --
- 93 Comments
accepted
grep --after-context=5 --before-context=10 'Nov 12 2012' yourfile.log
That'll show each line that contains your date text, as well as 10 lines of text BEFORE the line that matched, and 5 lines AFTER the line that matched.