Thursday 15 January 2015

bash - Grep output with multiple Colors? -


Is a great way to run a GP against a text file with two or more patterns, and each pattern Does the account have a different color output?

Then a line matching MALE and AUGUST will be inserted in blue and AUGUST < P> code> in orange? I am open to using sed , awk , grep and crayons or other ...

you --color = always specify by regular expression and crossing all the lines' foo | Using '$', you can cascade the grips with different colors.

For example:

  tail -f myfwlog | GREP_COLOR = '01; 36 'Blues - Color = Always' SH | $ '| | GREP_COLOR = '01; 31 'egrep -i --color = Always' drop | Reject $ '  

If you want to highlight the entire line, update your regular expression accordingly:

  .... GREP_COLOR = '01 ; 31 'egrep -i --color = always' ^. * Drop * $ ^. * turn down. * $$$ '   

No comments:

Post a Comment