grep Exception but exclude specific Exception

后端 未结 2 1093
眼角桃花
眼角桃花 2021-01-13 08:05

I am currently matching for \"Exception\" from a file, and output 10 lines before and after using:

grep -C 10 \"[.*Exception\"

2条回答
  •  执笔经年
    2021-01-13 08:41

    If you have grep -P you can specify a negative lookbehind assertion.

    grep -C 10 -P '\[.*(?

提交回复
热议问题