{"id":36403,"date":"2024-02-08T10:43:44","date_gmt":"2024-02-08T10:43:44","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=36403"},"modified":"2024-03-17T04:30:57","modified_gmt":"2024-03-17T04:30:57","slug":"bash-skip-first-line","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/","title":{"rendered":"4 Methods to Skip First Line of Bash Multiline String"},"content":{"rendered":"<p style=\"text-align: justify;\">In Bash, a multiline string is an essential tool for refining the text processing workflows and enhancing script functionality. While working with multiline strings, there are scenarios where you may need to exclude the first line for various reasons, whether removing headers from data files, skipping introductory comments, or simply adjusting the output format.<\/p>\n<p style=\"text-align: justify;\">To skip the first line of a multiline string, you can follow the following <strong>4<\/strong> methods:<\/p>\n<ol>\n<li>Using \u201ctail\u201d Command: <code class=\"\" data-line=\"\">tail -n +2 &lt;file_name&gt;<\/code><\/li>\n<li>Using \u201csed\u201d Command: <code class=\"\" data-line=\"\">sed &#039;1d&#039; &lt;file_name&gt;<\/code><\/li>\n<li>Using \u201cawk\u201d Command: <code class=\"\" data-line=\"\">awk &#039;NR&gt;1&#039; &lt;file_name&gt;<\/code><\/li>\n<li>Using \u201chead\u201d Command: <code class=\"\" data-line=\"\">head -n +2 &quot;$input_file&quot;<\/code><\/li>\n<\/ol>\n<p style=\"text-align: justify;\">Let\u2019s dive into the methods to learn how to skip the first line of a multiline string.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/Bash-skip-first-line.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 Skip First Line of Multiline String<\/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\/skip-first-line\/#1_Using_%E2%80%9Ctail%E2%80%9D_Command\" >1. Using \u201ctail\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#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-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#3_Using_%E2%80%9Cawk_Command\" >3. Using \u201cawk\u2019 Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#4_Using_the_%E2%80%9Chead%E2%80%9D_Command\" >4. Using the \u201chead\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#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-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#How_to_skip_the_first_line_using_NR_and_operator\" >How to skip the first line using NR and != operator?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#How_to_skip_the_range_of_lines_using_%E2%80%9Csed%E2%80%9D_in_Bash\" >How to skip the range of lines using \u201csed\u201d in Bash?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#How_do_you_line_break_in_Bash_script\" >How do you line break in Bash script?<\/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\/skip-first-line\/#How_to_skip_a_word_in_a_multiline_string_in_Bash\" >How to skip a word in a multiline string in Bash?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_Using_%E2%80%9Ctail%E2%80%9D_Command\"><\/span>1. Using \u201ctail\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/tail-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>tail command<\/strong><\/a> in Bash is used to display the last part of a file or input stream. and the option <strong>-n<\/strong> to skip the first line of a multiline string. The syntax is <code class=\"\" data-line=\"\">tail -n +2 &lt;file_name&gt;<\/code> tells the <strong>tail <\/strong>command to start displaying from the second line onwards.<\/p>\n<p style=\"text-align: justify;\">To skip the first line of the multiline string using the tail command, follow the script below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Define the multiline string\nmultiline_string=&#039;First line\nSecond line\nThird line&#039;\n\n#Print the multiline\necho &quot;The multiline string:&quot;\necho &quot;$multiline_string&quot;\necho\n\n# Skip the first line using tail\nskipped_string=$(echo &quot;$multiline_string&quot; | tail -n +2)\n\n# Output the result\necho &quot;The first line skipped string:&quot;\necho &quot;$skipped_string&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 uses the <strong>tail <\/strong>command with <code class=\"\" data-line=\"\">-n<\/code> option where <code class=\"\" data-line=\"\">-n<\/code> specifies the number of lines to display and <code class=\"\" data-line=\"\">+2<\/code> means starting from the second line. The syntax <code class=\"\" data-line=\"\">skipped_string=$(echo &quot;$multiline_string&quot; | tail -n +2)<\/code> takes the content of <strong>multiline_string<\/strong>, removes the first line using <strong>tail<\/strong>, and assigns the result to the variable <strong>skipped_string<\/strong>.<\/div><\/div>\n<p style=\"text-align: justify;\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-36410\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1-skip-the-first-line-using-tail-command.png\" alt=\"Bash skip the first line of a multiline string using the &quot;tail&quot; command.\" width=\"682\" height=\"292\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1-skip-the-first-line-using-tail-command.png 682w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1-skip-the-first-line-using-tail-command-300x128.png 300w\" sizes=\"(max-width: 682px) 100vw, 682px\" \/>The output shows the multiline string before and after skipping the first line.<\/p>\n<h2><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><\/h2>\n<p style=\"text-align: justify;\">You can use the \u201c<a href=\"https:\/\/linuxsimply.com\/sed-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>sed<\/strong><\/a>\u201d command with the command option <code class=\"\" data-line=\"\">1d<\/code> to skip first line in Bash of a multiline string. Follow the script below to skip the first line of the multiline string using the <strong>sed<\/strong> command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Define the multiline string\nmultiline_string=&#039;First line\nSecond line\nThird line&#039;\n\n#Print the multiline\necho &quot;The multiline string:&quot;\necho &quot;$multiline_string&quot;\necho\n\n# Skip the first line using sed\nskipped_string=$(echo &quot;$multiline_string&quot; | sed &#039;1d&#039;)\n\n# Output the result\necho &quot;The first line skipped string:&quot;\necho &quot;$multiline_string&quot;\necho -e &quot;\\nMultiline String after Skipping the First Line:&quot;\necho &quot;$skipped_string&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 uses the <strong>sed <\/strong>command to skip the first line. Here the <code class=\"\" data-line=\"\">echo &quot;$multiline_string&quot; | sed &#039;1d&#039;<\/code> command removes the first line from the multiline string and the resulting string is stored in the <strong>skipped_string<\/strong> variable.<\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-36411\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-skip-the-first-line-using-the-sed-command.png\" alt=\"Use the &quot;sed&quot; command to skip the first line of multiline string in Bash.\" width=\"700\" height=\"295\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-skip-the-first-line-using-the-sed-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.-skip-the-first-line-using-the-sed-command-300x126.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The output displays the multiline string after skipping the first line using the <strong>sed <\/strong>command.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Using_%E2%80%9Cawk_Command\"><\/span>3. Using \u201cawk\u2019 Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/awk-command-in-linux\/\" target=\"_blank\" rel=\"noopener\"><strong>awk command<\/strong><\/a> in bash is used to process text line by line. To skip the first line of a multiline string you can use\u00a0 <strong>NR <\/strong>which represents the record (line) number and the condition <code class=\"\" data-line=\"\">NR&gt;1<\/code> tells <strong>awk <\/strong>to start the processing from the second line onwards. See the script below to skip the first line of the multiline string using the awk command in Bash:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Define the multiline string\nmultiline_string=&#039;First line\nSecond line\nThird line&#039;\n\n# Skip the first line using awk\nskipped_string=$(echo &quot;$multiline_string&quot; | awk &#039;NR&gt;1&#039;)\n\n# Output the result\necho &quot;Original Multiline String:&quot;\necho &quot;$multiline_string&quot;\necho -e &quot;\\nMultiline String after Skipping the First Line:&quot;\necho &quot;$skipped_string&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\">This script initializes a <strong>multiline_string <\/strong>variable containing three lines. It uses the <strong>awk <\/strong>command with <strong>NR. <\/strong>The condition <code class=\"\" data-line=\"\">NR&gt;1<\/code> ensures that <strong>awk <\/strong>operates only on lines numbered greater than <code class=\"\" data-line=\"\">1<\/code>, effectively skipping the first line of the multiline string.<\/div><\/div>\n<p style=\"text-align: justify;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-36412\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.skip-the-first-line-using-the-awk-command.png\" alt=\"In bash, skip the first line of multiline string using the &quot;awk&quot; command.\" width=\"700\" height=\"264\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.skip-the-first-line-using-the-awk-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.skip-the-first-line-using-the-awk-command-300x113.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>The output presents both the multiline string and the string after skipping the first line.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Using_the_%E2%80%9Chead%E2%80%9D_Command\"><\/span>4. Using the \u201chead\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <a href=\"https:\/\/linuxsimply.com\/head-command-in-linux\/\"><strong>head command<\/strong><\/a> in Bash primarily displays the first few lines of a file or input stream. However, it can be leveraged to skip lines of a multiline string from the beginning. To skip lines using the <strong>head <\/strong>command, you can use the <code class=\"\" data-line=\"\">-n<\/code> option followed by the number of lines you want to skip. Here\u2019s how:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Define the multiline string\nmultiline_string=&#039;First line\nSecond line\nThird line&#039;\n\n# Skip the first line using head and assign the rest to a variable\nskipped_string=$(echo &quot;$multiline_string&quot; | head -n -1)\n\n# Output the result\necho &quot;Original Multiline String:&quot;\necho &quot;$multiline_string&quot;\n\n# Print the skipped string\necho &quot;Skipped string:&quot;\necho &quot;$skipped_string&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 initially defines a <strong>multiline string <\/strong>variable. In the command <code class=\"\" data-line=\"\">head -n -1<\/code>, the <code class=\"\" data-line=\"\">-n<\/code> option is used to specify the number of lines to display from the beginning of the input. When <code class=\"\" data-line=\"\">-n<\/code> is followed by a positive number, it indicates the exact number of lines to display.<\/div><\/div>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36413\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4-using-head.png\" alt=\"Skip the first line of a multiline string using the &quot;head&quot; command.\" width=\"662\" height=\"299\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4-using-head.png 662w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4-using-head-300x135.png 300w\" sizes=\"(max-width: 662px) 100vw, 662px\" \/>The output shows the multiline string after skipping the first line using the <strong>head <\/strong>command.<\/p>\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, skipping the first line of a multiline string is quite straightforward to achieve following the 4 methods. You can choose any of the methods such as<strong> \u201cawk\u201d, \u201csed\u201d, \u201ctail\u201d, <\/strong>or <strong>\u201chead\u201d <\/strong>commands to skip the lines from the beginning of the string involving different conditions. Hope this article sharpens your insight on this topic.<\/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=\"How_to_skip_the_first_line_using_NR_and_operator\"><\/span>How to skip the first line using NR and != operator?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>To skip the first line using <code class=\"\" data-line=\"\">NR<\/code> and <code class=\"\" data-line=\"\">!=<\/code> operator, follow the script below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\nmultiline_string=&#039;First line\nSecond line\nThird line&#039;\n\nstring=$(awk &#039;NR != 1&#039; &lt;&lt;&lt; &quot;$multiline_string&quot;)\necho &quot;$string&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\">Here, the <strong>awk<\/strong> reads each line of the multiline string, and if the line is not the first one (<code class=\"\" data-line=\"\">NR != 1<\/code>), it prints it to the output.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_skip_the_range_of_lines_using_%E2%80%9Csed%E2%80%9D_in_Bash\"><\/span>How to skip the range of lines using \u201csed\u201d in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To skip a range of lines in Bash, you can use the <strong>\u201csed\u201d <\/strong>command along with the <code class=\"\" data-line=\"\">d<\/code> parameter which specifies the range of lines to delete. Follow the script below to skip a range of lines:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n# Define the multiline string\nmultiline_string=&#039;First line\nSecond line\nThird line\nFourth line\nFifth line&#039;\n\n# Skip a range of lines using sed\nskipped_string=$(echo &quot;$multiline_string&quot; | sed &#039;2,4d&#039;)\n\n# Output the original and skipped strings\necho &quot;Original Multiline String:&quot;\necho &quot;$multiline_string&quot;\necho -e &quot;\\nMultiline String after Skipping a Range of Lines:&quot;\necho &quot;$skipped_string&quot;<\/code><\/pre>\n<p style=\"text-align: justify;\">In the script, the <code class=\"\" data-line=\"\">sed &#039;2,4d&#039;<\/code> command skips lines 2 to 4 from the multiline string in the output.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_do_you_line_break_in_Bash_script\"><\/span>How do you line break in Bash script?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In Bash scripts, you can use the newline character <code class=\"\" data-line=\"\">\\n<\/code> to create line breaks. Here are a few common ways to include line breaks:<\/p>\n<ol>\n<li>Using echo with the <code class=\"\" data-line=\"\">-e<\/code> option: <code class=\"\" data-line=\"\">echo -e &quot;Line 1\\nLine 2\\nLine 3&quot;<\/code><\/li>\n<li>Using printf: <code class=\"\" data-line=\"\">printf &quot;Line 1\\nLine 2\\nLine 3\\n&quot;<\/code><\/li>\n<li>Assigning a multi-line string to a variable: <code class=\"\" data-line=\"\">multiline_string=&quot;Line 1<\/code><\/li>\n<\/ol>\n<p><code class=\"\" data-line=\"\">Line 2<\/code><\/p>\n<p><code class=\"\" data-line=\"\">Line 3&quot;<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_skip_a_word_in_a_multiline_string_in_Bash\"><\/span>How to skip a word in a multiline string in Bash?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To skip a word in a multiline string in Bash, you can use the \u201csed\u201d, \u201cawk\u201d, or \u201cgrep\u201d command. The following script replaces a specific word from the multiline string using the <strong>sed<\/strong> command. Check the script below:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\n\n#Multiline string\nmultiline_string=&quot;This is a skipping multiline\nstring with several\nwords in it.&quot;\n\n#specify the word to skip\nword_to_skip=&quot;skipping&quot;\n\n# Skipping a word in the string\nskipped_string=$(echo &quot;$multiline_string&quot; | sed &quot;s\/$word_to_skip\/\/g&quot;)\necho &quot;$skipped_string&quot;<\/code><\/pre>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><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\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/newline\/\" target=\"_blank\" rel=\"noopener\">How to Echo Newline in Bash? [Complete Guide]<\/a><\/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;36403&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;4 Methods to Skip First Line of Bash Multiline String&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>In Bash, a multiline string is an essential tool for refining the text processing workflows and enhancing script functionality. While &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"4 Methods to Skip First Line of Bash Multiline String\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#more-36403\" aria-label=\"Read more about 4 Methods to Skip First Line of Bash Multiline String\">Read more<\/a><\/p>\n","protected":false},"author":314912,"featured_media":36414,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[198],"class_list":["post-36403","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>4 Methods to Skip First Line of Bash Multiline String - LinuxSimply<\/title>\n<meta name=\"description\" content=\"To skip the first line of a multiline Bash you can use the &quot;tail&quot;, &quot;awk&quot;, &quot;sed&quot;, and &quot;head&quot; command-tools within Bash scripts.\" \/>\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\/skip-first-line\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"4 Methods to Skip First Line of Bash Multiline String - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"To skip the first line of a multiline Bash you can use the &quot;tail&quot;, &quot;awk&quot;, &quot;sed&quot;, and &quot;head&quot; command-tools within Bash scripts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/\" \/>\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-08T10:43:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-17T04:30:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-Feature-image.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=\"5 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\\\/skip-first-line\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/\"},\"author\":{\"name\":\"Auhona Islam\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/25a3d16db4655804617c9e0c4a7989fb\"},\"headline\":\"4 Methods to Skip First Line of Bash Multiline String\",\"datePublished\":\"2024-02-08T10:43:44+00:00\",\"dateModified\":\"2024-03-17T04:30:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/\"},\"wordCount\":967,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/5-Feature-image.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\\\/skip-first-line\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/\",\"name\":\"4 Methods to Skip First Line of Bash Multiline String - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/5-Feature-image.png\",\"datePublished\":\"2024-02-08T10:43:44+00:00\",\"dateModified\":\"2024-03-17T04:30:57+00:00\",\"description\":\"To skip the first line of a multiline Bash you can use the \\\"tail\\\", \\\"awk\\\", \\\"sed\\\", and \\\"head\\\" command-tools within Bash scripts.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/5-Feature-image.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/5-Feature-image.png\",\"width\":400,\"height\":400,\"caption\":\"Skip the first line of bash multiline string.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/string\\\/multiline-string\\\/skip-first-line\\\/#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\":\"4 Methods to Skip First Line of Bash Multiline String\"}]},{\"@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":"4 Methods to Skip First Line of Bash Multiline String - LinuxSimply","description":"To skip the first line of a multiline Bash you can use the \"tail\", \"awk\", \"sed\", and \"head\" command-tools within Bash scripts.","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\/skip-first-line\/","og_locale":"en_US","og_type":"article","og_title":"4 Methods to Skip First Line of Bash Multiline String - LinuxSimply","og_description":"To skip the first line of a multiline Bash you can use the \"tail\", \"awk\", \"sed\", and \"head\" command-tools within Bash scripts.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/profile.php?id=100077694755838&mibextid=ZbWKwL","article_published_time":"2024-02-08T10:43:44+00:00","article_modified_time":"2024-03-17T04:30:57+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-Feature-image.png","type":"image\/png"}],"author":"Auhona Islam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Auhona Islam","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/"},"author":{"name":"Auhona Islam","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/25a3d16db4655804617c9e0c4a7989fb"},"headline":"4 Methods to Skip First Line of Bash Multiline String","datePublished":"2024-02-08T10:43:44+00:00","dateModified":"2024-03-17T04:30:57+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/"},"wordCount":967,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-Feature-image.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\/skip-first-line\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/","name":"4 Methods to Skip First Line of Bash Multiline String - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-Feature-image.png","datePublished":"2024-02-08T10:43:44+00:00","dateModified":"2024-03-17T04:30:57+00:00","description":"To skip the first line of a multiline Bash you can use the \"tail\", \"awk\", \"sed\", and \"head\" command-tools within Bash scripts.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-Feature-image.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5-Feature-image.png","width":400,"height":400,"caption":"Skip the first line of bash multiline string."},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/string\/multiline-string\/skip-first-line\/#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":"4 Methods to Skip First Line of Bash Multiline String"}]},{"@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\/36403","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=36403"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/36403\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/36414"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=36403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=36403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=36403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}