Mark As Completed Discussion

echo

echo is the most basic command in bash, which displays its arguments on standard output (on the terminal).

Syntax: echo[option]<text>

SNIPPET
1user@localhost:~$ echo "Hello World!"
2Hello World!
3user@localhost:~$ echo Hello World!
4Hello World!

Note that it is not necessary to enclose the text after the keyword echo in quotation symbols. However, it is recommended that you do so.

Another use of echo is when you want to display the value of system variables. For this, you need to use a dollar sign ($) before the variable name. For example, we can check the value of the current shell using the following command.

SNIPPET
1user@localhost:~$ echo $SHELL
2/bin/bash