Color regex matches - without dropping misses

后端 未结 7 906
日久生厌
日久生厌 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:53

    You could use the -C option to grep which shows you lines of context around your match. Just make sure is as least as large as the number of lines in your file.

提交回复
热议问题