<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sed on Raveen Kumar</title>
    <link>https://raveenkumar.com/tags/sed/</link>
    <description>Recent content in Sed on Raveen Kumar</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>Raveen Kumar</copyright>
    <lastBuildDate>Sat, 18 Feb 2023 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://raveenkumar.com/tags/sed/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Sed</title>
      <link>https://raveenkumar.com/library/programming/sed/</link>
      <pubDate>Sat, 18 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://raveenkumar.com/library/programming/sed/</guid>
      <description>&lt;h2 id=&#34;to-replace-text&#34;&gt;To replace text&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;sed &#39;s/text/replacement_text/g&#39; &amp;lt;file_name&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;to-replace-text-and-write-file&#34;&gt;To replace text and write file&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;sed -i &#39;s/text/replacement_text/g&#39; &amp;lt;file_name&amp;gt;&lt;/code&gt; ** Append to beginning&#xA;of a file sed -i &amp;lsquo;1i text&amp;rsquo; file.txt * &lt;a href=&#34;https://raveenkumar.com/library/programming/linux/&#34;&gt;back&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;find-and-replace-a-specific-line-from-all-files-in-current-directory-matching-a-specific-extension&#34;&gt;Find and replace a specific line from all files in current directory matching a specific extension&lt;/h2&gt;&#xA;&lt;p&gt;Here, all .md files have&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;a id=&amp;#34;org55550fd&amp;#34;&amp;gt;&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Line in it. The following command deletes those lines from all the files.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;find . -iname &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;*.md&amp;#34;&lt;/span&gt; -exec sed -i &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;/&amp;lt;a id=*/d&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;{}&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;\;&lt;/span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
