Shell Font Color display

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.