Shell script Color output (instance not edited)

Source: Internet
Author: User
Tags clear screen

Color output via echo output, need to add-E

ECHO-E "\033[background color; font Color \033[0m"

Background color

40 Setting a black background
41 Setting the red background
42 Setting the green background
43 Setting the brown background
44 Setting the blue background
45 Setting purple Background
46 Setting the Cyan background
47 Setting a white background
49 Setting the default black background

Font Color

30 setting Black foreground
31 set Red foreground
32 Setting Green foreground
33 Setting Brown foreground
34 Set Blue Foreground
35 Setting Purple foreground
36 Setting the Cyan foreground
37 Setting White foreground
38 underline on the default foreground color
39 Turn the underline off on the default foreground color

Special effects Control

0 Reset properties to default settings
1 setting Bold
2 Set half brightness (simulates color of color display)
4 Set underline (simulates color of color display)
5 Setting flashes
7 Setting the reverse image
22 Setting general Density
24 Turn underline off
25 Flashing off

Cursor control

\033[na the cursor to move n rows
\03[NB cursor down n rows
\033[NC cursor right shifts n rows
\033[nd cursor left n rows
\033[Y;XH Setting the cursor position
\033[2J Clear Screen
\033[k clears the contents from the cursor to the end of the line
\033[s Save Cursor position
\033[u Restore cursor Position
\033[?25L Hide/cursor

\33[?25h Display cursor

Shell script Color output (instance not edited)

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.