Is it possible to make stdout and stderr output be of different colors in XTerm or Konsole?

前端 未结 7 703
抹茶落季
抹茶落季 2021-01-30 17:16

Is it even achievable?

I would like the output from a command’s stderr to be rendered in a different color than stdout (for example, in red).

I ne

7条回答
  •  Happy的楠姐
    2021-01-30 17:42

    A simple solution to color stdout in red is to pipe it through grep:

    program | grep .
    

    This should not require installing anything, as grep should be already installed everywhere.

    Taken from Dennis’s comment on superuser.com.

提交回复
热议问题