Linux echo command

Echo is used to display the text or variables on the output screen. Echo is built-in command. Echo is older form of printf command. Linux/Unix echo command does not use format string like older form of printf.

-n: Which means No New Line. A line feed is automatically added after the string is displayed, it can be supressed with the -n option.
-e: Enable escape Sequence. If the -e option enabled then echo command will enable escape sequence.


Without -n Option:
Linux echo command

With -n Option:

echo command in Linux

Echo -e Option:
Option -e stands for enabling escape sequence in echo command. This is used when we want to print multiple lines of output using echo command. Following are the most used options in echo escape sequence.
\n – New line escape sequence.
\t – New horizontal tap escape sequence.

Without -e Option:

Linux echo command2

With -e Option:

Linux echo command3

Related Posts

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: