ITeye博客

Unix command coloring.

RobertLeeJesus · 2008-07-28 16:27 · Linux - Miscellaneous · Markdown

1. System.out.println("\u001b[1;31mhahahahhaha\u001b[1;37m");

           hahahahhaha

 

    \u001b[1;31m

    means to start with red.

 

    \u001b[1;37m

    means to start with default color, that is to say, close the coloring.

 

2. alias cvsDirty="cvs status | grep File | grep Modified | sed 's#\(File:.*Status:.*\)#\x1b[1;31m\1\x1b[1;37m#'"

    Create a alias to highlight the modified file.

 

File: L360-CEF-client-test.jpr    Status: Locally Modified
File: L360CEF.properties    Status: Locally Modified
File: L360-CEF-server.jpr    Status: Locally Modified
File: L360-CEF-server-test.jpr    Status: Locally Modified

 

    sed sytax, sed 's#SRC#DEST#" , replace all the matches SRC with DEST.

 

    \x1b[1;31m

    means to start with red.

 

    \x1b[1;37m

    means to start with default color, that is to say, close the coloring.

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。