The echo command is a useful choice for writing text in a terminal window. Its main task is to display text or string but not necessarily static text.
This command is available and is commonly used in shell scripts and batch files. And it is often used to output the results of other commands.
Here we will show you how to use the echo command in Linux as we did below. Hope you understand.
$ echo [option] [string]
To display a text or string:
$ echo [string]
$ echo "Hello"
1. \b remove all spaces
$ echo -e "Hello \bWorld"
You must use -e for the command to understand the meaning of “\”
2. \c remove the line after the option
$ echo -e "Hello \cWorld"
3. \n split newline
$ echo -e "Hello \nWorld"
4. \t separated by horizontal tab
$ echo -e "Hello \tWorld"
5. \r remove the line before the option
$ echo -e "Hello \rWorld"
6. \v separated by vertical tab
$ echo -e "Hello \vWorld"
7. echo* list all files/folders
$ echo *
We have shown you how to use echo command in Linux.
Thanks for referring!