Syntax highlighting/colorizing cat

前端 未结 18 1934
不思量自难忘°
不思量自难忘° 2020-12-02 03:39

Is there a method to colorize the output of cat, the way grep does.

For grep, in most consoles it displays a colored output hi

18条回答
  •  天涯浪人
    2020-12-02 04:32

    Place in your ~/.bashrc

    function ccat() { docker run -it -v "$(pwd)":/workdir -w /workdir whalebrew/pygmentize $1; }
    

    then

    ccat filename
    

    Whalebrew creates aliases for Docker images so you can run them as if they were native commands. It's like Homebrew, but with Docker images.

提交回复
热议问题