Created
December 3, 2014 18:23
-
-
Save virullius/5b2c66983dc2665df7a8 to your computer and use it in GitHub Desktop.
highlight matched text, linux shell
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
# trick is to match on a non-printing character (^ is beginning of line) OR your pattern. | |
# this way all lines match but only your pattern containing printable characters will be highlighted | |
# using ^ requires Extended-Regexp option (-E) | |
grep -E '^|pattern' file.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment