Function: Display a piece of text on the display, generally play the role of a hint.
Syntax: Echo [-ne][string] or echo [--help][--version]
Echo will send the input string to standard output I. The output strings are separated by white space characters, and a newline number is added at the end.
No line breaks: echo-n "character" or echo-e "character \c"
1. Echo Sample
Output sample
2. '-e' followed by ' \b ' removes all spaces between characters.
Note: The option '-e' in Linux plays the translation of the escape character backslash.
echo -e "Tecmint \bis \ba \bcommunity \bof \blinux \bnerds"
Output tecmintisacommunityoflinuxnerds
3. ' \ n ' line after '-e' in the place where it was encountered as a new row
echo -e "Tecmint \nis \na \ncommunity \nof \nlinux \nnerds" Output
Tecmint
Is
A
Community
Of
Linux
Nerds
4. Use the newline '\ n' With the Horizontal tab ' \t'
echo -e "Tecmint \tis \ta \tcommunity \tof \tlinux \tnerds"
Output Tecmint is a community of Linux nerds
5. '-e' followed by ' \v ' will add vertical tabs.
echo -e "\vtecmint \vis \va \vcommunity \vof \vlinux \vnerds"
Tecmint
Is
A
Community
Of
Linux
Nerds
6. Use the newline '\ n' With the Horizontal tab ' \t'
echo -e "\n\ttecmint \n\tis \n\ta \n\tcommunity \n\tof \n\tlinux \n\tnerds"
Output
Tecmint
is
A
Community
of
Linux
Nerds
7. You can use line break '\ n' with vertical tab '\v'
echo -e "\n\vtecmint \n\vis \n\va \n\vcommunity \n\vof \n\vlinux \n\vnerds"
Tecmint
Is
A
Community
Of
Linux
Nerds
8. '-e' followed by ' \ R ' to specify the carriage return character in the output. (LCTT: The characters at the beginning of a line will be covered)
echo -e "Tecmint \ris a community of Linux nerds"
Output
is a community of Linux nerds
-N |
does not output a newline character at the end. |
-E |
Enable backslash escaping. |
\b |
Backspace |
\\ |
Reverse Slash |
\ n |
New lines |
\ r |
Enter |
\ t |
Horizontal tab |
\v |
Vertical tab |
1th Linux Command--echo