:The third detailed explanation of the echo command: detailed explanation of the additional font color of the string-Appreciation of masterpieces免费ppt模版下载-道格办公

The third detailed explanation of the echo command: detailed explanation of the additional font color of the string

Parameters to achieve the effect of appending font colors to strings. In Linux systems, you can use ANSI escape sequences to achieve this function. An ANSI escape sequence is a series of characters starting with "\033[", which is used to control the color

  • < /ul>
    《SSH service coping with brute force attack tool》Follow [FreeOps] on WeChat, reply [0120] to get it
01 Detailed explanation of basic parameters

When writing scripts, in order to improve the visual effect, you can use the echo function to add different colors to the standard output strings, and achieve different effects through different colors. Today, we finished the experiment by talking about echo adding different colors to string fonts.

This experiment summarizes the display of strings of different colors through the echo command, and shows them one by one through examples. Next, let's sort out the relevant formats and classifications of setting the string color, and then demonstrate them one by one.

The basic format for setting the string color is: echo-e '

Classification of commonly used string colors. The details are shown in the following table:

Note:
1)The above string format The double quotation marks in are all English characters;
2 ) '*' in the above string format represents different string characters; < /section>
3)Whether there is a space between the color code and the string in the above string format Space, does not affect the actual output effect of processing string color;
02 < /strong>Detailed explanation of basic parameters

Through the above arrangement, we It can be roughly understood that different color strings can be displayed through different command formats. Below we show the specific output effects one by one through examples. The details are as follows:

1. The output string is black

As mentioned above, the output will be processed by the command Strings are displayed in standard black font. The details are shown in the following figure:

2. The output string is Red

As mentioned above, the character string to be output is displayed as a standard red font after being processed by the command. The details are shown in the following figure:

3. The output string is green< /strong>

As mentioned above, after processing the string to be output by the command Displayed in standard green font. The details are shown in the following figure:

4. The output string is yellow< /strong>

As mentioned above, after processing the string to be output by the command Displayed in standard yellow font. The details are shown in the following figure:

5. The output string is blue< /span>

As mentioned above, processing through the command will output is displayed in standard blue font. The details are shown in the following figure:

6. The output string is purple

As mentioned above, by command Displayed in a standard purple font after processing the string to be output. The details are shown in the following figure:

7. The output string is sky blue

As mentioned above, the string to be output is processed by the command Afterwards, it is displayed in a standard sky blue font. The details are shown in the following figure:

8. The output string is white

as above As described above, the character string to be output is displayed as a standard white font after being processed by the command. The details are shown in the following figure:

Copyright by FreeOps
Please indicate the source when reprinting
Contribution address: freeops@sina.com


Recent Hot Articles

CentOS system optimization tools you must know

mysql_config_editor of MySQL hidden password

You may not know the ping command

MySQL database forgets the password, you can deal with it like this

CentOS v7.x upgrade OpenSSH service

Detailed explanation of remote automatic backup of MySQL database

Today's benefits:《SSH service responds to violent attacks Tools" (1) Shell writing, which can be modified according to needs;(2) Combining with crontab to realize IP address blocking and unblocking;Follow [FreeOps] on WeChat, reply [0120] You can get

Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/The%20third%20detailed%20explanation%20of%20the%20echo%20command%20detailed%20explanation%20of%20the%20additional%20font%20color%20of%20the%20string.html

Like (810)
Reward 支付宝扫一扫 支付宝扫一扫
single-end

Related Suggestion