Changing the Linux shell foreground and background colors

Source: Internet
Author: User
Tags set background

Set to white on black background

Echo-e "/033[037;40m"

Color is selected by adding a dedicated sequence-basically a numeric value sandwiched between "/e[" and "M". If more than one numeric code is specified, separate them with semicolons.
Echo-e "/e[31;40m"
The first number (31) is the foreground color (red), the second number is (40) the background color (black)
Echo-e "/e[0m"
We need to use the "/e[0m" sequence to reset the color to normal.
/033[30m--/033[37m set foreground color (font colors)
/033[30m change the display color of a character to black
/033[31m change the display color of a character to red
/033[32m change the display color of a character to green
/033[33m change the display color of a character to light red
/033[34m change the display color of a character to blue
/033[35m change the display color of a character to purple
/033[36m change the display color of a character to light blue
/033[37m change the display color of a character to Gray

/033[40m--/033[47m Set background color
/033[40m setting the background color to black
/033[41m setting the background color to red
/033[42m setting the background color to green
/033[43m setting the background color to light red
/033[44m set the background color to blue
/033[45m set the background color to purple
/033[46m setting the background color to light blue
/033[47m setting the background color to gray

Changing the Linux shell foreground and background colors

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.