Shell Display with color font

Source: Internet
Author: User
Tags clear screen set background

Format: echo "/033[word background color; font color m string/033[control code"
If you simply display the font color can be fixed control code bit 0m.
Format: echo "/033[word background color; font Color m string/033[0m"

Word background color range: 40-49

 + : Black  A : Crimson  the : Green  + : Yellow  - : Blue  $ : Purple  $ : Dark green A: White

Word Color: 30-39

 - : Black  to : Red  + : Green  - : Yellow  the : Blue  * : Purple  $ : Dark green Panax Notoginseng: White

ANSI Control code

\ -[0m close all properties \ -[01m set high brightness \ -[04m underline \ -[05m blinking \ -[07m reverse display \ -[08m blanking \ -[30m--\ -[37m set foreground color \ -[40m--\ -[47m set background color \ -[NA cursor moves up n rows \ -[NB cursor moves down n lines \ -[NC cursor shifts right n rows \ -[ND cursor moves left n rows \ -[y;xh set cursor position \ -[2J clear screen \ -[K clears the contents from the cursor to the end of the line \ -[s save cursor position \ -[u restore cursor position \ -[?25lHide cursor \ -[? 25h display cursor

For example:

" \033[31m \033[05m Please confirm your operation, enter [y/n] \033[0m""\033[31m \033[05m Please confirm your operation, enter [y/ N] \033[0m"

Shell Display with color font

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: 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.