<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ali&#039;s Blog &#187; perl</title>
	<atom:link href="http://www.almahdi.cc/tag/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.almahdi.cc</link>
	<description>Made from the best stuff on earth</description>
	<lastBuildDate>Tue, 24 Jan 2012 10:16:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Replace text in many files using perl</title>
		<link>http://www.almahdi.cc/linux/replace-text-in-many-files-using-perl/</link>
		<comments>http://www.almahdi.cc/linux/replace-text-in-many-files-using-perl/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 05:51:27 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux replace text]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[replace text]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://almahdi.cc/?p=402</guid>
		<description><![CDATA[Last night, I have several files containing the same text and I wanted that text to be replaced. I used perl one liner to do the job and I thought it may be useful for someone else so here it is: perl -e &#8220;s/text/replacewith/g;&#8221; -pi.orig *.txt This is going to save a backup of the [...]]]></description>
			<content:encoded><![CDATA[<p>Last night, I have several files containing the same text and I wanted that text to be replaced. I used perl one liner to do the job and I thought it may be useful for someone else so here it is:</p>
<blockquote><p>perl -e &#8220;s/text/replacewith/g;&#8221; -pi.orig *.txt</p></blockquote>
<p>This is going to save a backup of the files with .orig extension and do the replace. If you don&#8217;t want backup, then remove the .orig from the line.</p>
<p>Also, if you want to replace text in all files in a directory, then use:</p>
<blockquote><p>perl -e &#8220;s/text/replacewith/g;&#8221; -pi.orig $(find . -type f)</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.almahdi.cc%2Flinux%2Freplace-text-in-many-files-using-perl%2F&amp;title=Replace%20text%20in%20many%20files%20using%20perl" id="wpa2a_2"><img src="http://www.almahdi.cc/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.almahdi.cc/linux/replace-text-in-many-files-using-perl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

