Created
August 27, 2016 13:23
-
-
Save detj/afacae33cca98d1beff829f1693dee70 to your computer and use it in GitHub Desktop.
Grab bunch of lines before & after certain keyword
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # grab 10 lines before & after the pattern | |
| # make sure escape sequences are reained so it looks pretty (that's what the -r flag is for in less) | |
| grep -B 10 -A 10 "error" file.log | less -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment