{"id":37788,"date":"2024-02-29T08:44:40","date_gmt":"2024-02-29T08:44:40","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=37788"},"modified":"2024-03-17T04:31:36","modified_gmt":"2024-03-17T04:31:36","slug":"bash-newline","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/","title":{"rendered":"How to Echo Newline in Bash? [Complete Guide]"},"content":{"rendered":"<p style=\"text-align: justify;\">Bash newline is known as a linebreak that marks the end of a line code or command. The newline is represented by the escape sequence <code class=\"\" data-line=\"\">\\n<\/code>. It plays a crucial role in structuring commands and scripts effectively. This article aims to provide a comprehensive guide on newlines and methods to echo new lines into text and codes.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/Practice-Files-to-Echo-Line-Break.zip\" class=\"su-button su-button-style-default\" style=\"color:#000000;background-color:#e8f9ff;border-color:#bac8cc;border-radius:56px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#000000;padding:8px 26px;font-size:20px;line-height:30px;border-color:#effbff;border-radius:56px;text-shadow:0px 0px 0px #000000\"><i class=\"sui sui-download\" style=\"font-size:20px;color:#1aa1d6\"><\/i> Practice Files to Echo Line Break<\/span><\/a><\/div>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#A_Echo_Newline_to_Formatted_Text\" >A. Echo Newline to Formatted Text<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#1_Using_%E2%80%9Cecho%E2%80%9D_Command\" >1. Using \u201cecho\u201d Command<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#I_With_%E2%80%9C%E2%80%9D_Sign\" >I. With \u201c$\u201d Sign<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#II_Using_multiple_%E2%80%9Cecho%E2%80%9D_statement\" >II. Using multiple \u201cecho\u201d statement<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#III_With_Variables\" >III. With Variables<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#2_Using_%E2%80%9Cprintf%E2%80%9D_Command\" >2. Using &#8220;printf&#8221; Command<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#B_Echo_Newline_Automatically_to_the_Text\" >B. Echo Newline Automatically to the Text<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#C_Echo_Newline_Replacing_a_Specific_Character\" >C. Echo Newline Replacing a Specific Character<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#1_Using_%E2%80%9Ctr%E2%80%9D_Command\" >1. Using \u201ctr\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#2_Using_%E2%80%9Csed%E2%80%9D_Command\" >2. Using \u201csed\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#3_Using_%E2%80%9Cawk%E2%80%9D_Command\" >3. Using \u201cawk\u201d Command<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#How_to_adopt_Line-continuation_in_Long_Shell_Commands\" >How to adopt Line-continuation in Long Shell Commands?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#Solved_Echo_Command_Not_Recognizing_%E2%80%98n\" >[Solved] Echo Command Not Recognizing \u2018\\n\u2019<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#People_Also_Ask\" >People Also Ask<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#What_is_meant_by_line_break\" >What is meant by line break?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#How_do_I_separate_lines_in_Bash\" >How do I separate lines in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#What_is_%E2%80%9Cn%E2%80%9D_in_Bash\" >What is &#8220;\\n&#8221; in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#What_is_%E2%80%9Cr%E2%80%9D_in_string\" >What is &#8220;\\r&#8221; in string?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#How_do_you_break_a_string_line\" >How do you break a string line?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#Why_is_it_important_to_consider_line_breaks_in_Bash_scripting\" >Why is it important to consider line breaks in Bash scripting?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#What_is_line_continuation_in_Bash\" >What is line continuation in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#How_to_print_newline_in_Bash\" >How to print newline in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#How_to_echo_the_newline_character_in_Bash\" >How to echo the newline character in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#How_do_you_line_break_in_the_Bash_terminal\" >How do you line break in the Bash terminal?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"A_Echo_Newline_to_Formatted_Text\"><\/span>A. Echo Newline to Formatted Text<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In Bash, sometimes it\u2019s necessary to insert a newline within a lengthy text to make it shorter. It can be done by using the \u201cecho\u201d command, \u201cprintf\u201d command, and using the dollar \u201c$\u201d sign.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Using_%E2%80%9Cecho%E2%80%9D_Command\"><\/span>1. Using \u201cecho\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/echo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>echo<\/strong>\u00a0<strong>command<\/strong><\/a> is the most used approach to insert newline characters <code class=\"\" data-line=\"\">\\n<\/code> within long text. You can use the\u00a0<strong>echo <\/strong>command along with the <code class=\"\" data-line=\"\">-e<\/code> option to echo newline. Here the option enables escape\u00a0 sequence interpretation within the <b>double-quotation<\/b>\u00a0<code class=\"\" data-line=\"\">&quot;&quot;<\/code>. Check the following code to echo line break or newline within a text:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo -e &quot;First line\\nSecond line&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">The <code class=\"\" data-line=\"\">-e<\/code> option enables the interpretation of escape sequences in the string.<\/div><\/div>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-37794\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.-echo-e-command.png\" alt=\"Echo line breaks within text using the &quot;echo&quot; command with the &quot;-e&quot; option.\" width=\"700\" height=\"88\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.-echo-e-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.-echo-e-command-300x38.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The output shows the inserted new line within the text line.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"I_With_%E2%80%9C%E2%80%9D_Sign\"><\/span>I. With \u201c$\u201d Sign<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">Instead of using the <code class=\"\" data-line=\"\">-e<\/code> option, you can use the <strong>dollar <\/strong>sign (<code class=\"\" data-line=\"\">$<\/code>) with the <code class=\"\" data-line=\"\">echo<\/code> command to echo the new. Follow the below code to echo the newline:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo $&#039;First Line\\n Second Line&#039;<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> In the code, the <code class=\"\" data-line=\"\">$&#039;...&#039;<\/code> syntax allows interpretation of certain escape sequences inside the string.<\/div><\/div>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-37796\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.-using-the-dollar-sign.png\" alt=\"Echo line breaks with the dollar &quot;$&quot; sign.\" width=\"700\" height=\"90\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.-using-the-dollar-sign.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.-using-the-dollar-sign-300x39.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The output displays the text after echoing newline characters within it.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"II_Using_multiple_%E2%80%9Cecho%E2%80%9D_statement\"><\/span>II. Using multiple \u201cecho\u201d statement<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">You can simply use the <code class=\"\" data-line=\"\">echo<\/code> command multiple times to echo line break in the output as below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\necho &quot;First line&quot;\n\necho &quot;Second line&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"aligncenter wp-image-37795 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-multiple-echo.png\" alt=\"Echo line breaks with the &quot;echo&quot; command multiple times.\" width=\"486\" height=\"101\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-multiple-echo.png 486w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-multiple-echo-300x62.png 300w\" sizes=\"(max-width: 486px) 100vw, 486px\" \/>The output shows the result of echoing line breaks in the text using the <strong>echo <\/strong>command multiple times.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"III_With_Variables\"><\/span>III. With Variables<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p style=\"text-align: justify;\">You can use the <code class=\"\" data-line=\"\">echo<\/code> command along with the <code class=\"\" data-line=\"\">-e<\/code> option and the <strong>dollar <\/strong>sign (<code class=\"\" data-line=\"\">$<\/code>) to add a line break with a defined variable.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nstr1=&#039;Hello&#039;\n\nstr2=&#039;World&#039;\n\necho -e &quot;$str1\\n$str2&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> The script uses the <code class=\"\" data-line=\"\">echo<\/code> command with the <code class=\"\" data-line=\"\">-e<\/code> option to interpret escape sequences, specifically <code class=\"\" data-line=\"\">\\n<\/code> which represents a newline character. The dollar sign (<code class=\"\" data-line=\"\">$<\/code>) is used to access the values stored in variables in Bash. <\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-37797 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-using-the-variable.png\" alt=\"Echo line breaks with variables.\" width=\"530\" height=\"102\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-using-the-variable.png 530w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-using-the-variable-300x58.png 300w\" sizes=\"(max-width: 530px) 100vw, 530px\" \/>A newline is inserted within two variables in the output.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Using_%E2%80%9Cprintf%E2%80%9D_Command\"><\/span>2. Using &#8220;printf&#8221; Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can use the <strong>printf<\/strong> command to echo newline characters within the text. Follow the command below to print a line break within the text:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">printf &quot;First Line\\n Second Line \\n&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">The command <code class=\"\" data-line=\"\">printf &quot;First Line\\n Second Line \\n&quot;<\/code> prints two lines of text. The <code class=\"\" data-line=\"\">\\n<\/code> represents a newline character, causing the text to be displayed on separate lines.<\/div><\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37798\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.-using-the-printf.png\" alt=\"Use the &quot;printf&quot; command to echo line breaks.\" width=\"825\" height=\"99\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.-using-the-printf.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.-using-the-printf-300x36.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.-using-the-printf-768x92.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>The output shows the echoed newline characters within the text.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"B_Echo_Newline_Automatically_to_the_Text\"><\/span>B. Echo Newline Automatically to the Text<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In Bash, you can use a <strong><a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/\" target=\"_blank\" rel=\"noopener\">loop<\/a><\/strong> to automatically echo newline within the text. For example, check the following script to echo newline within text automatically:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nstring=&quot;Hello World&quot;\nresult=&quot;&quot;\n\nfor word in $string; do\nresult=&quot;$result$word\\n&quot;\ndone\necho -e &quot;$result&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> The script initializes a <strong>string variable.<\/strong> Then it iterates over each word of the string using a <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/for-loop\/\" target=\"_blank\" rel=\"noopener\"><strong>for loop<\/strong><\/a><strong>. <\/strong>The script appends each word of the <strong>string <\/strong>to the <strong>result<\/strong> variable followed by the <code class=\"\" data-line=\"\">\\n<\/code> escape sequence using the expression <code class=\"\" data-line=\"\">result=&quot;$result$word\\n&quot;<\/code><strong>. <\/strong>This is how the script echoes the newline within the <strong>string.<\/strong><\/div><\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-37799 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.-automatic.png\" alt=\"Echo Bash newline within text automatically.\" width=\"648\" height=\"119\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.-automatic.png 648w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.-automatic-300x55.png 300w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/>The output shows the string after echoing the newline automatically using the loop.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"C_Echo_Newline_Replacing_a_Specific_Character\"><\/span>C. Echo Newline Replacing a Specific Character<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In Bash, you can echo newline within the text by replacing a specific character with the line break or newline character (<code class=\"\" data-line=\"\">\\n<\/code>) using the \u201ctr\u201d, \u201csed\u201d, and \u201cawk\u201d commands. This section describes the methods to echo newline by replacing a specific character.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Using_%E2%80%9Ctr%E2%80%9D_Command\"><\/span>1. Using \u201ctr\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/tr-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>tr command<\/strong><\/a> in bash translates or deletes characters. You can use it to replace a specific character with newline characters (<code class=\"\" data-line=\"\">\\n<\/code>). Check the following script to replace a specific character with a newline:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nstring=&quot;First Second Third&quot;\n\necho $string | tr &quot; &quot; &quot;\\n&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">Initially, it defines a variable named <strong>string<\/strong> holding the value &#8220;First Second Third&#8221;. Subsequently, the <strong>echo<\/strong> command is employed to display the content of the <strong>string<\/strong> variable. The <code class=\"\" data-line=\"\">|<\/code> operator pipes this output as input to the<strong> tr<\/strong> command. Within the <strong>tr<\/strong> command, it specifies replacing space characters <code class=\"\" data-line=\"\">&quot; &quot;<\/code> with newline characters &#8220;<code class=\"\" data-line=\"\">\\n<\/code>&#8220;. <\/div><\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-37800 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.-using-tr-command.png\" alt=\"Echo Bash newline using the &quot;tr&quot; Command.\" width=\"475\" height=\"138\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.-using-tr-command.png 475w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.-using-tr-command-300x87.png 300w\" sizes=\"(max-width: 475px) 100vw, 475px\" \/>The output displays the text after echoing the newline.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Using_%E2%80%9Csed%E2%80%9D_Command\"><\/span>2. Using \u201csed\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/sed-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>sed command<\/strong><\/a> is a powerful tool in Bash for text processing and manipulation. It reads text input line by line, and applies specified operations to each line.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo &quot;Hello World&quot; | sed &#039;s\/ \/\\n\/g&#039;<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> Within the <strong>sed<\/strong> command, the expression <code class=\"\" data-line=\"\">&#039;s\/ \/\\n\/g&#039;<\/code> is used. Here, <code class=\"\" data-line=\"\">s\/ \/\\n\/g<\/code> is a substitution command. It tells <strong>sed<\/strong> to find all occurrences of the space character <code class=\"\" data-line=\"\">&#039; &#039;<\/code> and replace them with a newline character <code class=\"\" data-line=\"\">\\n<\/code>. The <code class=\"\" data-line=\"\">g<\/code> flag ensures that this substitution is applied globally, meaning it will replace all instances of space in the input string, not just the first one.<\/div><\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-37801 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-using-sed-command.png\" alt=\"Echo newline in Bash using the &quot;sed&quot; command.\" width=\"825\" height=\"101\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-using-sed-command.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-using-sed-command-300x37.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/8-using-sed-command-768x94.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/>The output shows the string after inserting the line break within it using the <strong>sed <\/strong>command.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Using_%E2%80%9Cawk%E2%80%9D_Command\"><\/span>3. Using \u201cawk\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The <a href=\"https:\/\/linuxsimply.com\/awk-command-in-linux\/\"><strong>awk<\/strong><\/a> <a href=\"https:\/\/linuxsimply.com\/awk-command-in-linux\/\"><strong>command<\/strong><\/a> is effective for searching for patterns and processing files. It&#8217;s used in scripts to search through one or multiple files, locate matching patterns, and execute specific tasks. You can use \u201cawk\u201d to replace any specific character with the line break or newline character (\\n). Follow the below script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo &quot;Hello World&quot; | awk &#039;{gsub(&quot; &quot;, &quot;\\n&quot;)}1&#039;<\/code><\/pre>\n<p style=\"text-align: justify;\"><div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\"> The <code class=\"\" data-line=\"\">gsub(&quot; &quot;, &quot;\\n&quot;)<\/code> function within awk replaces each space <code class=\"\" data-line=\"\">&quot; &quot;<\/code> with a newline character <code class=\"\" data-line=\"\">\\n<\/code>. The <strong>1<\/strong> at the end acts as a pattern that always evaluates to <strong>true<\/strong>, ensuring awk prints the modified string.<\/div><\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-37802 size-full\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-using-awk-command.png\" alt=\"Echo bash newline using the &quot;awk&quot; command.\" width=\"1024\" height=\"108\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-using-awk-command.png 1024w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-using-awk-command-300x32.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/9-using-awk-command-768x81.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/>The output shows the string after replacing the space with the newline character (<code class=\"\" data-line=\"\">\\n<\/code>).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_to_adopt_Line-continuation_in_Long_Shell_Commands\"><\/span>How to adopt Line-continuation in Long Shell Commands?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><strong>Line continuation<\/strong> is the ability to expand a command in multiple lines to break a long command. You can use the <strong>backslash\u00a0<code class=\"\" data-line=\"\">\\<\/code><\/strong> or <strong>single quotation<\/strong> <code class=\"\" data-line=\"\">&#039;&#039;<\/code> to continue a command in multiple lines. To continue a long command in multiple lines by using backslashes <code class=\"\" data-line=\"\">\\<\/code> to continue the command on the next line.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">long_command_with_many_arguments \\\nargument1 \\\nargument2 \\\nargument3 \\\n...<\/code><\/pre>\n<p>Here\u2019s an example with a longer command using pipes:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">cat file.txt \\\n| grep &quot;pattern&quot; \\\n| sed &#039;s\/foo\/bar\/g&#039; \\\n| awk &#039;{print $1}&#039;<\/code><\/pre>\n<p>Breaking the long commands can greatly improve the readability of complex commands.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Solved_Echo_Command_Not_Recognizing_%E2%80%98n\"><\/span>[Solved] Echo Command Not Recognizing \u2018\\n\u2019<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">When using the \u2018echo\u2019 command in Bash, the regular syntax doesn\u2019t interpret escape sequences like <code class=\"\" data-line=\"\">\\n<\/code> as newline characters. For example, the following code doesn\u2019t interpret <code class=\"\" data-line=\"\">\\n<\/code>\u00a0as escape sequence.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo &#039;Hello\\nWorld&#039;\n\n##Output\nHello\\nWorld<\/code><\/pre>\n<p style=\"text-align: justify;\">To have it interpret such escape sequences, you need to use the <code class=\"\" data-line=\"\">-e<\/code> option. So, to display &#8220;Hello&#8221; on one line and &#8220;World&#8221; on the next, write the following code:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo -e &#039;Hello\\nWorld&#039;\n\n##output\nHello\nworld<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To sum up, this guide demonstrates the line break and the processes to echo line breaks within large text. You can use any of the descriptive methods to echo line breaks such as using the <strong>echo <\/strong>command, <strong>printf <\/strong>command. You can use the \u201csed\u201d, \u201cawk\u201d, and \u201ctr\u201d commands to replace any specific character with the line break character <code class=\"\" data-line=\"\">\\n<\/code>. Hope this article helps you navigate through the process of echoing line breaks within texts.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"What_is_meant_by_line_break\"><\/span>What is meant by line break?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A line break, also known as newline, is a sequence of characters (<code class=\"\" data-line=\"\">\\n<\/code>) that indicate the end of one line of text and the beginning of the next line within a document, file, or text.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_separate_lines_in_Bash\"><\/span>How do I separate lines in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">You can separate lines in Bash by using the <strong>echo <\/strong>command with the <code class=\"\" data-line=\"\">-e<\/code> option to interpret the escape sequence (\\n) as below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">echo -e &quot;Line 1\\nLine 2&quot;\n\n##Output\nLine 1\nLine 2<\/code><\/pre>\n<p style=\"text-align: justify;\">Alternatively, you can use the <strong>printf<\/strong> command with the newline character <code class=\"\" data-line=\"\">\\n<\/code>:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">printf &quot;Line 1\\nLine 2\\n&quot;\n\n##Output\nLine 1\nLine\u00a0 2<\/code><\/pre>\n<p style=\"text-align: justify;\">This is how you can separate lines in Bash.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_is_%E2%80%9Cn%E2%80%9D_in_Bash\"><\/span>What is &#8220;\\n&#8221; in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In Bash, <code class=\"\" data-line=\"\">\\n<\/code> is a line break or newline and indicates the start of a new line. When the shell encounters <code class=\"\" data-line=\"\">\\n<\/code> in a string, it moves the cursor to the beginning of the next line. This is useful for formatting output or constructing multiline strings in Bash.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_is_%E2%80%9Cr%E2%80%9D_in_string\"><\/span>What is &#8220;\\r&#8221; in string?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In string, <code class=\"\" data-line=\"\">\\r<\/code> is the carriage return character that tells the program or terminal to move the cursor to the beginning of the current line without going to the next line. It\u2019s used in older systems like macOS and some versions of Windows to represent a line break.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_you_break_a_string_line\"><\/span>How do you break a string line?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To break a string line, you can use the backslash <code class=\"\" data-line=\"\">\\<\/code> at the end of each line to indicate that the string continues on the next line. For example:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">string=&quot;This is a long string \\\nthat spans multiple lines.&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\">This allows you to break a long string into multiple lines for better readability.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Why_is_it_important_to_consider_line_breaks_in_Bash_scripting\"><\/span>Why is it important to consider line breaks in Bash scripting?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Line breaks in Bash is necessary for several reasons which are:<\/p>\n<ol>\n<li style=\"text-align: justify;\"><strong>Readability:<\/strong> Long, complex commands can be challenging to understand when written in a single line. That\u2019s why, breaking them into multiple lines makes it easier to read, and understand.<\/li>\n<li style=\"text-align: justify;\"><strong>Maintainability: <\/strong>Breaking long commands into smaller segments allows easier modification, debugging, and troubleshooting.<\/li>\n<li style=\"text-align: justify;\"><strong>Error Prevention:<\/strong> Long lines increase the probability of errors such as typos, and syntax errors. By breaking the commands into smaller and manageable lines, developers can reduce the risk of errors.<\/li>\n<li style=\"text-align: justify;\"><strong>Collaboration: <\/strong>When multiple developers working on a script, clear and consistent line breaks can improve the collaboration to understand each other\u2019s contribution.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"What_is_line_continuation_in_Bash\"><\/span>What is line continuation in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Line continuation in Bash is the ability to extend a command across multiple lines. There are two methods to achieve line continuation in Bash. One is using the backslash\u00a0<code class=\"\" data-line=\"\">\\<\/code> and another is using the single quotes\u00a0<code class=\"\" data-line=\"\">&#039;&#039;<\/code> . Using a backslash at the end of a line indicates that the command continues on the next line. Similarly, wrapping the command in a single quote allows it to span multiple lines.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_print_newline_in_Bash\"><\/span>How to print newline in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In Bash, to print a newline character, you can use the <strong>echo<\/strong> command or\u00a0<strong>printf <\/strong>command. You can use the <strong>echo\u00a0<\/strong>command along with option\u00a0<strong>e <\/strong>or\u00a0the dollar sign <code class=\"\" data-line=\"\">$<\/code> to interpret the newline character within a string or text as special characters rather than literal backslashes such as\u00a0<code class=\"\" data-line=\"\">echo $&#039;First Line\\nSecond Line&#039;<\/code>. In the case of using <strong>printf<\/strong>, you can simply write like this command\u00a0<code class=\"\" data-line=\"\">printf &quot;&quot;First Line\\nSecond Line \\n<\/code> to echo newline in Bash.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_echo_the_newline_character_in_Bash\"><\/span><span style=\"font-family: inherit; font-size: 29px; font-style: inherit;\">How to echo the newline character in Bash?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In Bash, you can print a newline character using the echo command with the <code class=\"\" data-line=\"\">-e<\/code> option followed by the newline character <code class=\"\" data-line=\"\">\\n<\/code>. For example, to echo a newline within the text, you can use the expression <code class=\"\" data-line=\"\">echo -e &quot;First Line\\nSecond Line&quot;<\/code>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_you_line_break_in_the_Bash_terminal\"><\/span>How do you line break in the Bash terminal?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In the Bash terminal, you can line break within a long command by simply adding a <strong>backslash<\/strong> and pressing\u00a0<strong>ENTER.\u00a0<\/strong>For example, to count the number of words within a text, you can use the command <code class=\"\" data-line=\"\">echo &quot;hello world&quot; | wc -w<\/code>. Now if want to break the command line in the terminal, you can write <code class=\"\" data-line=\"\">echo &quot;hello world&quot; | \\<\/code> then press\u00a0<strong>ENTER\u00a0<\/strong> and write the rest of the command like this\u00a0<code class=\"\" data-line=\"\">wc -w<\/code>. Both commands will output the same result.<\/p>\n<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"What is meant by line break?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"A line break, also known as newline, is a sequence of characters (\\n) that indicate the end of one line of text and the beginning of the next line within a document, file, or text.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What is \\n in Bash?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"In Bash, \\n is a line break or newline and indicates the start of a new line. When the shell encounters \\n in a string, it moves the cursor to the beginning of the next line. This is useful for formatting output or constructing multiline strings in Bash.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What is \\r in string?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"In string, \\r is the carriage return character that tells the program or terminal to move the cursor to the beginning of the current line without going to the next line. It\u2019s used in older systems like macOS and some versions of Windows to represent a line break.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"What is line continuation in Bash?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Line continuation in Bash is the ability to extend a command across multiple lines. There are two methods to achieve line continuation in Bash. One is using the backslash\u00a0and another is using the single quotes\u00a0. Using a backslash at the end of a line indicates that the command continues on the next line. Similarly, wrapping the command in a single quote allows it to span multiple lines.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How to print newline in Bash?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"In Bash, to print a newline character, you can use the echo command or\u00a0printf command. You can use the echo\u00a0command along with option\u00a0e or\u00a0the dollar sign $ to interpret the newline character within a string or text as special characters rather than literal backslashes such as\u00a0echo $'First Line\\nSecond Line'. In the case of using printf, you can simply write like this command\u00a0printf \\\"\\\"First Line\\nSecond Line \\n to echo newline in Bash.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"How to echo the newline character in Bash?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"In Bash, you can print a newline character using the echo command with the -e option followed by the newline character \\n. For example, to echo a newline within the text, you can use the expression echo -e \\\"First Line\\nSecond Line\\\".\"\n    }\n  }]\n}\n<\/script><\/p>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/\" target=\"_blank\" rel=\"noopener\">4 Methods to Skip First Line of Bash Multiline String<\/a><\/strong><strong><span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;How to Echo Newline in Bash? [Complete Guide]&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/\"><br \/>\n<\/span><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/remove-empty-lines\/\" target=\"_blank\" rel=\"noopener\">How to Remove Empty Lines in Bash? [5 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/remove-newline\/\" target=\"_blank\" rel=\"noopener\">How to Remove Newline from String in Bash? [7 Methods]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Multiline String&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/\" target=\"_blank\" rel=\"noopener\">Bash Multiline String<\/a><\/span> |\u00a0<span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash String&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/\" target=\"_blank\" rel=\"noopener\">Bash String<\/a><\/span> | <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Scripting Tutorial&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Tutorial<\/a><\/span><\/strong><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;37788&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;How to Echo Newline in Bash? [Complete Guide]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bash newline is known as a linebreak that marks the end of a line code or command. The newline is &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Echo Newline in Bash? [Complete Guide]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#more-37788\" aria-label=\"Read more about How to Echo Newline in Bash? [Complete Guide]\">Read more<\/a><\/p>\n","protected":false},"author":314912,"featured_media":38148,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[198],"class_list":["post-37788","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-multiline-string","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Echo Newline in Bash? [Complete Guide] - LinuxSimply<\/title>\n<meta name=\"description\" content=\"In Bash, newline plays an essential role in breaking long lines or codes into shorter ones to make it more convenient for the developers.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Echo Newline in Bash? [Complete Guide] - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"In Bash, newline plays an essential role in breaking long lines or codes into shorter ones to make it more convenient for the developers.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/profile.php?id=100077694755838&amp;mibextid=ZbWKwL\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-29T08:44:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-17T04:31:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-feature-image-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Auhona Islam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Auhona Islam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/\"},\"author\":{\"name\":\"Auhona Islam\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/25a3d16db4655804617c9e0c4a7989fb\"},\"headline\":\"How to Echo Newline in Bash? [Complete Guide]\",\"datePublished\":\"2024-02-29T08:44:40+00:00\",\"dateModified\":\"2024-03-17T04:31:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/\"},\"wordCount\":1887,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/10-feature-image-2.png\",\"keywords\":[\"multiline string\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/\",\"name\":\"How to Echo Newline in Bash? [Complete Guide] - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/10-feature-image-2.png\",\"datePublished\":\"2024-02-29T08:44:40+00:00\",\"dateModified\":\"2024-03-17T04:31:36+00:00\",\"description\":\"In Bash, newline plays an essential role in breaking long lines or codes into shorter ones to make it more convenient for the developers.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/10-feature-image-2.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/10-feature-image-2.png\",\"width\":400,\"height\":400,\"caption\":\"Echo newline in Bash.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/newline\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Scripting Tutorial\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Bash String\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Bash Multiline String\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to Echo Newline in Bash? [Complete Guide]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/25a3d16db4655804617c9e0c4a7989fb\",\"name\":\"Auhona Islam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Auhona-Islam-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Auhona-Islam-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Auhona-Islam-II-96x96.png\",\"caption\":\"Auhona Islam\"},\"description\":\"Auhona Islam is a dedicated professional with a background in Electronics and Communication Engineering (ECE) from Khulna University of Engineering &amp; Technology. Graduating in 2023, Auhona is currently excelling in her role as a Linux content developer executive at SOFTEKO to provide a more straightforward route for Linux users. She aims to generate compelling materials for Linux users with her knowledge and skills. She holds her enthusiasm in the realm of Machine Learning (ML), Deep Learning (DL), and Artificial Intelligence (AI). Apart from these, she has a passion for playing instruments and singing. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=100077694755838&mibextid=ZbWKwL\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/auhona-islam-429822208\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/auhona\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Echo Newline in Bash? [Complete Guide] - LinuxSimply","description":"In Bash, newline plays an essential role in breaking long lines or codes into shorter ones to make it more convenient for the developers.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/","og_locale":"en_US","og_type":"article","og_title":"How to Echo Newline in Bash? [Complete Guide] - LinuxSimply","og_description":"In Bash, newline plays an essential role in breaking long lines or codes into shorter ones to make it more convenient for the developers.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/profile.php?id=100077694755838&mibextid=ZbWKwL","article_published_time":"2024-02-29T08:44:40+00:00","article_modified_time":"2024-03-17T04:31:36+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-feature-image-2.png","type":"image\/png"}],"author":"Auhona Islam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Auhona Islam","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/"},"author":{"name":"Auhona Islam","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/25a3d16db4655804617c9e0c4a7989fb"},"headline":"How to Echo Newline in Bash? [Complete Guide]","datePublished":"2024-02-29T08:44:40+00:00","dateModified":"2024-03-17T04:31:36+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/"},"wordCount":1887,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-feature-image-2.png","keywords":["multiline string"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/","name":"How to Echo Newline in Bash? [Complete Guide] - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-feature-image-2.png","datePublished":"2024-02-29T08:44:40+00:00","dateModified":"2024-03-17T04:31:36+00:00","description":"In Bash, newline plays an essential role in breaking long lines or codes into shorter ones to make it more convenient for the developers.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-feature-image-2.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/10-feature-image-2.png","width":400,"height":400,"caption":"Echo newline in Bash."},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"Bash Scripting Tutorial","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/"},{"@type":"ListItem","position":3,"name":"Bash String","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/"},{"@type":"ListItem","position":4,"name":"Bash Multiline String","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/"},{"@type":"ListItem","position":5,"name":"How to Echo Newline in Bash? [Complete Guide]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/25a3d16db4655804617c9e0c4a7989fb","name":"Auhona Islam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Auhona-Islam-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Auhona-Islam-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Auhona-Islam-II-96x96.png","caption":"Auhona Islam"},"description":"Auhona Islam is a dedicated professional with a background in Electronics and Communication Engineering (ECE) from Khulna University of Engineering &amp; Technology. Graduating in 2023, Auhona is currently excelling in her role as a Linux content developer executive at SOFTEKO to provide a more straightforward route for Linux users. She aims to generate compelling materials for Linux users with her knowledge and skills. She holds her enthusiasm in the realm of Machine Learning (ML), Deep Learning (DL), and Artificial Intelligence (AI). Apart from these, she has a passion for playing instruments and singing. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/profile.php?id=100077694755838&mibextid=ZbWKwL","https:\/\/www.linkedin.com\/in\/auhona-islam-429822208"],"url":"https:\/\/linuxsimply.com\/author\/auhona\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/37788","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314912"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=37788"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/37788\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/38148"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=37788"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=37788"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=37788"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}