<?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>Hello, I am Sean Murphy &#187; find/replace</title>
	<atom:link href="http://iamseanmurphy.com/tag/findreplace/feed/" rel="self" type="application/rss+xml" />
	<link>http://iamseanmurphy.com</link>
	<description>Thoughts, news, code by Sean Murphy</description>
	<lastBuildDate>Thu, 26 Jan 2012 02:37:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Recursive Find and Replace With grep and Perl</title>
		<link>http://iamseanmurphy.com/2009/04/11/recursive-find-and-replace-with-grep-and-perl/</link>
		<comments>http://iamseanmurphy.com/2009/04/11/recursive-find-and-replace-with-grep-and-perl/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 20:51:56 +0000</pubDate>
		<dc:creator>Sean Murphy</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[find/replace]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://iamseanmurphy.com/2009/04/11/recursive-find-and-replace-with-grep-and-perl/</guid>
		<description><![CDATA[I thought it might be a nice idea to start posting useful little commands and bits of code every now and then&#8211;ones I&#8217;ve found to be particularly useful. So here&#8217;s the first one, recursive find and replace. A masterfully crafted regular expression paired with this command can save you hours of tedious work. This will [...]]]></description>
			<content:encoded><![CDATA[<p>I thought it might be a nice idea to start posting useful little commands and bits of code every now and then&#8211;ones I&#8217;ve found to be particularly useful. So here&#8217;s the first one, recursive find and replace. A masterfully crafted regular expression paired with this command can save you hours of tedious work.</p>
<p><span id="more-32"></span><br />
This will search all files recursively for SEARCH_STRING and replace all occurrences of SEARCH_STRING with REPLACE_STRING throughout each unique file found. It also creates a backup of each modified file so that FILE is backed-up as FILE~ (with a tilde).</p>
<pre name="code" class="python">grep -R --files-with-matches 'SEARCH_STRING' . | sort | uniq | xargs perl -pi~ -e 's/SEARCH_STRING/REPLACE_STRING/'</pre>
]]></content:encoded>
			<wfw:commentRss>http://iamseanmurphy.com/2009/04/11/recursive-find-and-replace-with-grep-and-perl/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

