Color in grep output to distinquish the matching entries

Most of the times I end up spending a lot of time to look for the string in the grep output when I do a search. This is quite frustrating and thus I looked at the options for grep command that would make my life easier and there definately is something. Here it is:

export GREP_COLOR=\”5;36\”

But for this to work you would still need to give the \”–color=auto\” option in the grep command. There are two ways to do this, create a alias for grep as \”grep –color=auto\” or specify the same in GREPOPTIONS.

Another option that is quite useful is \”-n\” in conjuntion with \”-f\”, which will show the line numbers also along with the filename.

grep -v with multiple patterns.

$ sed \'/test/{/error|critical|warning/d}\' somefile If you wanted to do all in one command, you could go w/ sed instead

\"\"

by David Winterbottom (codeinthehole.com)

\"\"
\"\"

\"\"

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/LjKzo7FpzDU/grep-v-with-multiple-patterns.

\"Reblog