Color style and property control for shell scripts

Source: Internet
Author: User
Tags clear screen set background

First look at the format

Echo-e "\033[word background color; text color m string \033[0m"

Example

Echo-e "\033[41;36m Font \033[0m"

Where 41 of the position represents the background, 36 of the position is the color of the word

Note:

1, the word background color and the text color is in English

2. There is a m behind the text color

3, before and after the string can have no space, if any, the output is also a space

Here is the corresponding word and background color, you can try to find out the different color collocation

Detailed description
Echo-e "\033[31m red word \033[0m" echo-e "\033[34m yellow word \033[0m" echo-e "\033[41;33m red bottom yellow word \033[0m" echo-e "\033[41;37m Red Bottom White \033[0m "

Word Color: 30-–37

Echo-e "\033[30m black word \033[0m" echo-e "\033[31m red word \033[0m" echo-e "\033[32m green word \033[0m" echo-e "\033[33m yellow word \033[0m "Echo-e" \033[34m blue word \033[0m "echo-e" \033[35m purple word \033[0m "echo-e" \033[36m sky blue Word \033[0m "echo-e" \033[37m white word \033[ 0m "

Word background color range: 40-–47

Echo-e "\033[40;37m Black Bottom White \033[0m" echo-e "\033[41;37m Red bottom White \033[0m" echo-e "\033[42;37m Green bottom White \033[0m" echo-e "\033[43; 37m Yellow bottom White \033[0m "echo-e" \033[44;37m Blue bottom White \033[0m "echo-e" \033[45;37m purple white \033[0m "echo-e" \033[46;37m Blue Sky White \033[0m "Echo-e" \033[47;30m black character \033[0m "on white background"

Last Face Control option description

\33[0m Close All properties \33[1m set high brightness \33[4m underline \33[5m flicker \33[7m reverse \33[8m blanking \33[30m-\33[37m set foreground color \33[40m-\33[47m set background colors \33[na Cursor up n line \33[NB cursor down n line \33[NC cursor right shift n line \33[nd cursor left n row \33[y;xh set cursor position \33[2j Clear screen \33[k clear from cursor to end of line \33[s save cursor position \33[u restore cursor position \33 [? 25l Hide cursor \33[?25h display cursor

Color style and property control for shell scripts

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.