Format: "\033[display mode; front color; background color m string \033[0m"
\033: Starting an escape sequence
[: Start Color definition
There are several ways to display the method:
0 Terminal default settings
1 高亮显示
4 使用下划线
5 闪烁
7 反白显示
8 不可见
The number of foreground and background colors corresponds to the following:
Foreground background color
--------------------------------------
30 40 Black
31 41 Red
32 42 Green
33 43 yellow
34 44 Blue
35 45 Purplish red
36 46 Cyan Blue
37 47 白色
M: Indispensable
\033[0m: Restore original default color
For example:
Comparison of display modes:
[email protected] : ~# echo-e "\033[0; 31;40m string \033[0m "
String
[email protected ] : ~# echo-e "\033[1;31;40m string \033[0m"
String
[email protected] : ~# echo-e "\033[4;31; 40m string \033[0m "
String
[email protected] : ~# echo-e "\033[5;31;40m string \033[0m"
String
[email protected] : ~# echo-e "\033[7;31; 40m string \033[0m "
String
[email protected] : ~# echo-e "\033[8;31;40m string \033[0m"
String
650) this.width=650; "title=" 2014-11-05_133916.png "src=" http://s3.51cto.com/wyfs02/M01/4D/C7/ Wkiol1rzumjiwwfmaamt68tyyva837.jpg "alt=" Wkiol1rzumjiwwfmaamt68tyyva837.jpg "/>
Shell Font Color display