Colorized grep — viewing the entire file with highlighted matches

前端 未结 21 2438
野趣味
野趣味 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

    You can use my highlight script from https://github.com/kepkin/dev-shell-essentials

    It's better than grep because you can highlight each match with its own color.

    $ command_here | highlight green "input" | highlight red "output"
    

    Screen shot from Github project

提交回复
热议问题