In Linux, echo is a DOS batch processing command that can be used to set the display state of the command line or create new files. This article will explain in detail how to use the Linux command echo?
echo: echo [-neE] [arg ...] string
echo will be sent to the input standard output. The output strings are separated by white space characters and a newline number is added at the end.
Options:
-n Don't wrap at the end
-e Interpret with backslash
-E Suppress backslash interpretation
When using the -e option, if the following characters appear in the string, they are treated specially instead of being treated as normal text:
•\\a gives a warning;
•\\b deletes the previous character;
•\\c does not add a newline symbol at the end;
•\\f wraps the line but the cursor remains in its original position; Br>
•\ Wrap and move the cursor to the beginning of the line;
•\
The cursor moves to the beginning of the line, but does not wrap;
•\\t Horizontal tabulation ;
•\\v vertical tab;
•\\\\ insert\\character;
•\ nn insert ASCII represented by nnn (octal) Characters;
Use the echo command to print the text of special effects:
\\e[nm n is a numeric code, multiple separated by <;”
text color code : reset=0, black=30, red =31, green=32, yellow=33, blue=34, magenta=35, cyan=36, white=37
background color code: reset=0, black=40, red=41, Green=42, yellow=43, blue=44, magenta=45, cyan=46, white=47
Other numeric parameters: 0 turn off all attributes, 1 set high brightness (bold), 4 underline , 5 flashes, 7 reverses, 8 blanks
Text color:
echo -e “\\e[31mThis is red text\\e[0m”This is red text
Background color:
echo -e “\\e[42mGreed Background\\e[0m”Greed Background
Text bold:
echo -e “ \\e[1mThis is strong text\\e[0m”This is strong text
The above is the entire content of the echo command in Linux. It can be seen that the main function of the echo command is to display the internal information of the command. .
Linux system The full name of Go language is golang, which is a programming development language. Th
In Linux system, in addition to PHP can view the file directory, the shell command
Google Chrome is the most widely used browser on Linux, which may be why Google Chrome runs faster.
When using rsync to transfer large files, Linux system cannot guarantee the complet
FreeBSD steps to load iso files through virtual CD-ROMs
How does Ubuntu recover the GNOME Panel that was accidentally deleted?
How to solve the Linux account expiration?
Little-known Unix command inventory
What should I do if the Linux system formats the partition and prompts Could not start /dev?
RedHat 6 uses xrdp to log in to Windows Remote Desktop
How to expand Xen virtual hard disk space by Linux
Two methods of Deepin system update
How to use the cut command to intercept file information in Linux
Linux adds custom encryption algorithms to OpenSSL
What if the CentOS 5.5 system does not recognize the Atheros AR8151 NIC?
Win10u disk write protection how to get rid of win10 remove u disk write protection graphic tutorial
What should I do if the WinXP system is blacked out due to too high resolution setting?
[Video Demo] Microsoft Win10 latest touchpad gesture function detailed
How to hide/show disk drive number
How does Win8 solve the problem that the Security Center service cannot be started?
Windows8 uses image password and pin password to log in.
The backup and restore function of Win7 system is improved again.
How to set up Win8.1 system compatible with pirate ship fan?