Linux ANSI control code

Source: Internet
Author: User
Linux end ANSI control Code format: \ 033 [background color; Font color m string \ 033 [0 mprintf (& quot; \ 033 [41; 32 m font background is red, the word is green \ 033 [0 M \ n & quot;); 41 is the back color of the word, 32 is the font color, the font background is red, and the word is Green is a string. \ 033... linux Terminal ANSI control Code format: \ 033 [word background color; Font color m string \ 033 [0 mprintf ("\ 033 [41; 32 m font background is red, the word is green \ 033 [0 M \ n "); 41 is the back color of the word, 32 is the font color, the font background is red, and the word is Green is the string. the \ 033 [0 M is the control code. www.2cto.com color code: QUOTE: word background color range: 40--49 word color: 30--39 40: Black 30: black 41: red 31: Red 42: Green 32: green 43: Yellow 33: yellow 44: Blue 34: Blue 45: Purple 35: purple 46: dark green 36: dark green 47: White 37: White ANSI control code: QUOTE: \ 033 [0 m close all properties \ 033 [1 m set high brightness \ 03 [4 m underline \ 033 [5 m flashing \ 033 [7 m reverse display \ 033 [8 m hide \ 033 [30 m -- \ 033 [37 m set foreground color \ 033 [40 m -- \ 033 [47 m set background color \ 033 [nA cursor move n rows up \ 03 [nB cursor move down n rows \ 033 [nC cursor shifted to n rows \ 033 [nD cursor shifted to n rows \ 033 [y; xH set the cursor position \ 033 [2J clear screen \ 033 [K clear content from the cursor to the end of the line \ 033 [s save the cursor position \ 033 [u restore the cursor position \ 033 [? 25l hide the cursor \ 33 [? 25 h show the detailed excerpt of the cursor www.2cto.com as follows: \ 033 [0 m close all properties \ 033 [1 m set high brightness \ 033 [4 m underline \ 033 [5 m flashing \ 033 [7 m reverse display \ 033 [8 m hide \ 033 [30 m -- \ 033 [37 m set foreground color \ 033 [40 m -- \ 033 [47 m set background color \ 033 [nA cursor move n rows up \ 033 [nB cursor move down n rows \ 033 [nC cursor shifted to n rows \ 033 [nD cursor shifted to n rows \ 033 [y; xH set the cursor position \ 033 [2J clear screen \ 033 [K clear content from the cursor to the end of the line \ 033 [s save the cursor position \ 033 [u restore the cursor position \ 033 [? 25l hide the cursor \ 033 [? 25 h show cursor [ M sets the Display attribute. you can set one or more attributes for the same sequence. all properties of par 0 are reset to default value 1 set border www.2cto.com 2 set brightness halved (use one color to simulate another color) 4. set the shading (use one color to simulate another) (the color used for simulation is determined by using ESC]... 5. set flashing 7. set reverse video 10. reset the selected image to display the control tag and reverse the element tag. 11. select an empty image, set the display control tag, and reset the reverse tag. 12. select an empty image, set the display control tag, and reset the reverse tag. (the reverse mark causes the high reverse of each byte before the image table is converted .) 21 set normal brightness (not compatible with ECMA-48) 22 set normal brightness 24 turn off underline 25 do not flash 27 reverse video turn off 30 black foreground 31 red foreground 32 green foreground 33 Brown foreground 34 blue foreground 35 magenta foreground 36 peacock blue foreground 37 white foreground 38 open underline, set the default foreground color 39 to close the underline, set Default foreground color 40 black background 41 red background 42 green background 43 brown background 44 Blue background 45 magenta background 46 peacock blue background 47 white background 49 set default background color www.2cto.com example: for example, you need to output "Hello" with an underscore in gray background red format: \ 033 [44; 31m \ 033 [4m hello \ 033 [0 m description: there are 3 control strings in total: \ 033 [44; 31 m (highlighted in red), \ 033 [4 m (underline), \ 033 [0 m (close all settings) author gaojie
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.