This page is about the echo executable of the Gnu utility package that implements an echo functionality.
echo is also often implemented as a shell built-in command:
To echo a string:
/bin/echo [OPTION]... [STRING]...
where:
If -e is in effect, the following sequences are recognized:
This characters are control characters.
See the example interpretation of non visible characters
The echo utility is found:
In bash, with the type command, you can check if it's the echo bash builtin command and not GNU echo.
type echo
echo is a shell builtin
echo -e "hello Nico\nHello Nico"!
hello Nico
Hello Nico!
echo 'hello Nico\nHello Nico!'
hello Nico
Hello Nico!
By default, echo outputs along a newline character at the end. This behavior can be disabled with the -n options
Example within the bash shell:
for a in `seq 10`
do
echo -n "$a "
done
1 2 3 4 5 6 7 8 9 10
for a in `seq 10`
do
echo "$a "
done
1
2
3
4
5
6
7
8
9
10