Several code lifting shell forcing

Source: Internet
Author: User

Guide In Linux, shell commands are efficient at running concurrent processing tasks, and shell scripts are not tedious, not only for the magic sound but also for the shell's color display. Now we'll use the color in the shell to improve the shell script in seconds.

Let's give an example:

Echo-e "\033[44;37;5m ME \033[0m COOL"

The above command sets the background to blue, foreground white, blinking cursor, output character "ME", then reset screen to default settings, output character "COOL". "E" is an optional option for the command echo, which is used to activate the parser for special characters. "\033" guides the non-regular character sequence. "M" means to set the property and then end the unconventional character sequence, the real valid characters in this example are "44;37;5" and "0". modifying "44;37;5" can produce combinations of different colors, which are not related to the sequence of values and encodings.

Color coding Meaning

Encoding      color/action  0        reset properties to default settings  1         set bold  2        set half brightness (color of analog color display)  4         Set the underline (simulates the color of the color display)  5        Set Flicker  7        Set reverse image  22       set general density  24       Turn off underline  25       turn off flashing  27        Turn off reverse image  30       set black foreground  31        set red foreground  32       set green foreground  33        set brown foreground  34       set blue foreground  35        set purple foreground  36       set cyan foreground  37        set White foreground  38       set underline on default foreground color  39       turn underline on default foreground color  40        set black background  41       set red background  42        Set Green background  43       set brown background  44        Set blue background  45       set purple background  46        set cyan background  47       set white background  49        Set Default black background

Color coded with

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 33[0m "

650) this.width=650; "src=" Http://www.linuxprobe.com/wp-content/uploads/2017/05/1-3.png "width=" 837 "height=" 340 " class= "Alignnone size-full wp-image-70241" style= "Height:auto;"/>

Linux Font 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[0 M

650) this.width=650; "src=" Http://www.linuxprobe.com/wp-content/uploads/2017/05/2-2.png "width=" 835 "height=" 411 " class= "Alignnone size-full wp-image-70242" style= "Height:auto;"/>

Linux Font background color 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"

650) this.width=650; "src=" Http://www.linuxprobe.com/wp-content/uploads/2017/05/3-2.png "width=" 821 "height=" 405 " class= "Alignnone size-full wp-image-70243" style= "Height:auto;"/>

Color-coded font flashing:

Echo-e "\033[42;30;5m wwww \033[0m" echo-e "\033[47;30;5m wwww \033[0m"

650) this.width=650; "src=" Http://www.linuxprobe.com/wp-content/uploads/2017/05/4-2.png "width=" 787 "height=" 202 " class= "Alignnone size-full wp-image-70244" style= "Height:auto;"/>


Original address: http://www.linuxprobe.com/use-color-shell.html

This article is from the "blog" blog, please be sure to keep this source http://coderhsf.blog.51cto.com/12629645/1931789

Several code lifting shell forcing

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.