Introduction
Just like iOS, Windows, Linux is also an Operating System. In fact, the Andriod operating system, which is one of the most popular platforms, is powered by the Linux operating system. Organizations and individuals use Linux for their servers as it is flexible and secure, and we can receive amazing support from a large community of users.

We can easily install Linux in our system, or there are computers such as System76 or Purism with already installed Lunix. In this article, we are going to see how to echo a new line in Linux. So stay till the end, to learn the most of it!
Echo a New Line in Linux
Echo new line command in Linux is very essential for showing formatted text output. So let's start with various methods to echo a new line in Linux, allowing effective output formatting.
Displaying New Line with -r flag of Echo command
While working with the echo command in Linux, we can use the -e flag to display a new line. It is a recommended option for echoing a new line. It enables the interpretation of escape sequences, which makes it easier to format our results. The escape sequence used for a new line is the \n character. The command is as follows:
Output:

Echo a Variable containing a New Line
Linux operating system gives us very effective ways to handle cases where we need to echo the contents of a variable containing newline characters. The command for this is as follows:
Output:

In the above example, we have assigned a multi-lined string to the variable new_var. By providing the variable within double quotes and using the -e flag with the echo command, the shell will interpret the newline character stored within the variable. Due to this, we have got the above output.
Using ‘$’ Character
We can use the '$' character instead of the -e flag with the echo command in Linux to echo a new line. It makes the process simple and easy when the -e flag is not preferred or unavailable.
Output:

The '$' gives the same result as the -e flag; the only difference is in syntax. However, this is not as flexible as the -e flag; it only interprets escape sequence and doesn't support other formatting options.
Using Echo with Echo to print something with New Line
In some situations, we may need to echo the result of an echo command for printing text that includes a new line. The command to use nesting echo is as follows:
Output:

In the above example, we have used the nesting echo command to create the desired line of text, and the outer echo command is responsible for printing the whole output. This method is not considered as the most efficient approach in terms of performance. As nesting multiple commands can lead to unnecessary overheads.
Using printf command in Bash shell
The print command in the Bash shell is considered an effective method for printing new lines. Its formatting and flexibility options make it powerful for controlling the output layout. The example is as follows:
Output:

In the above example, we have used printf instead of the echo command.