Linux,shell script, font color and settings

Source: Internet
Author: User
Tags clear screen set background

Shell echo display in script with color display , echo display with color, need to use parameter- e
The format is as follows:
echo-e "\033[ word background color; text color m string \033[0m"   
For example:
echo-e "\033[41;36msomething here \033[0m"  
where the position of the two represents the background, the position of the map is the color of the word
Note:

ShellIn the scriptEchoDisplay content with color display, EchoDisplay with color, need to use parameters- E
The format is as follows:
   echo-e "\033[Word background color; text colormString\033[0m "
For example:
   echo-e "\033[41;36m something here\033[0m"
which AThe position represents the background, $The position is the color of the representative word
Note:
   1, the word background color and the text color are in English""
   2, the text color is followed by am
   3, there can be no space before and after the string, if any, the output also has a space
Here is the corresponding word and background color, you can try to find out the different color collocation
Cases
   echo-e“\033[31mRed 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   White on red background\033[0m"
Word color:37-–
  echo-e "\033[30m black character \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:47-–
echo-e "\033[40;37m   White on black background\033[0m"
echo-e "\033[41;37m   White on red background\033[0m"
echo-e "\033[42;37m   White on Green background\033[0m”
echo-e "\033[43;37m   White on yellow background\033[0m"
echo-e "\033[44;37m   White on blue background\033[0m"
echo-e "\033[45;37m   White on purple background\033[0m"
echo-e "\033[46;37m   Blue Sky and white lettering\033[0m"
echo-e "\033[47;30m   black word on white background\033[0m”
Last Face Control option description
   \33[0mClose All Properties
   \33[1mSet High brightness
   \33[4mUnderline
   \33[5mFlashing
   \33[7mReverse Display
   \33[8mBlanking
   \33[30m—\33[37mSet foreground color
   \33[40m—\33[47mSet Background color
   \33[naMove Cursor upNYes
   \33[NBMove Cursor DownNYes
   \33[NCMove Cursor RightNYes
   \33[ndMove Cursor LeftNYes
   \33[y;xhSet cursor position
   \33[2jClear Screen
   \33[kClears the contents from the cursor to the end of the line
   \33[sSave Cursor position
   \33[uRestore cursor Position
   \33[?25lHide cursor
   \33[?25hDisplay cursor

\e[--The starting position of the hint that represents the color
x;ym-- The code that represents the color. The color code is described below (of course, you can write more than one, with ";" Separate, e.g. 1;5;35m)
\e[m-- the end position of the hint that represents the color of the generation

the value of x is:

0 OFF
1 highlighting
4 Underline
5 Flashing
7 anti-white display
8 not visible


This article is from the "13219718" blog, please be sure to keep this source http://13229718.blog.51cto.com/13219718/1971326

Linux,shell script, font color and settings

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.