Color regex matches - without dropping misses

后端 未结 7 892
日久生厌
日久生厌 2021-02-07 02:21

When using grep --color=always I can get pretty color highlighting for regex matches.

However, grep only returns lines with at least one match.

7条回答
  •  余生分开走
    2021-02-07 02:48

    I'm digging this little python utility. If not on debian, use alien to convert to rpm.

    http://korpus.juls.savba.sk/~garabik/software/grc.html

    regexp=.*red
    colours="\033[38;5;160m"
    count=once
    

    This is a nice page on terminal colors.

    http://www.pixelbeat.org/docs/terminal_colours/

    (Queen's english is so colourful.)

提交回复
热议问题