Bash scripting is quite popular is the easiest scripting language. Like any programming or scripting language, you come across printing text on the terminal. This can happen in numerous scenarios such as when you want to output the contents of a file or check the value of a variable. Programmers also debug their applications by printing the values of their variables on the console. Therefore, before we delve into bash scripting which will be another tutorial, let’s look at the different ways in which we could output text in the terminal.
Echo is the most important command that you need to know in order to output text on the terminal. As the name itself suggests, echo displays number or string on standard output in the terminal. It also has a number of options available as shown in the table below.
| Options | Definition |
| -n | Do not print the trailing newline |
| -E | Disable interpretation of back-slash escaped characters |
| -e | Enable interpretation of backslash escapes |
| \a | Alert |
| \b | Backspace |
| \c | Suppress trailing newline |
| \e | Escape |
| \f | Form feed |
| \\ | backslash |
| \n | New line |
| \r | Carriage return |
| \t | Horizontal tab |
| \v | Vertical tab |
According to the Linux documentation, the following is the syntax for echo command.
echo [option(s)][string(s)]
Now, we shall see the different ways in which we can output the text on the terminal.









