echo Linux Commands
What is Linux echo Command?
Explanation
echo COMMAND:echo command prints the given input string to standard output.
SYNTAX :
echo [options..] [string]
OPTIONS:
-n |
do not output the trailing newline |
-e |
enable interpretation of the backslash-escaped characters listed below |
-E |
disable interpretation of those sequences in STRINGs |
Without -E, the following sequences are recognized and interpolated:
NNN |
the character whose ASCII code is NNN (octal) |
a |
alert (BEL) |
|
backslash |
b |
backspace |
c |
suppress trailing newline |
f |
form feed |
n |
new line |
r |
carriage return |
t |
horizontal tab |
v |
vertical tab |
EXAMPLE:
- echo command
echo "hscripts Hiox India"
The above command will print as hscripts Hiox India
- To use backspace:
echo -e "hscripts bHiox bIndia"
The above command will remove space and print as hscriptsHioxIndia
- To use tab space in echo command
echo -e "hscriptstHioxtIndia"
The above command will print as hscriptsHioxIndia