Colorized grep — viewing the entire file with highlighted matches

前端 未结 21 2439
野趣味
野趣味 2020-11-28 00:17

I find grep\'s --color=always flag to be tremendously useful. However, grep only prints lines with matches (unless you ask for context lines). Give

21条回答
  •  一整个雨季
    2020-11-28 00:27

    If you want highlight several patterns with different colors see this bash script.

    Basic usage:

    echo warn error debug info 10 nil | colog
    

    You can change patterns and colors while running pressing one key and then enter key.

提交回复
热议问题