<?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>Lee Newton &#187; find</title>
	<atom:link href="http://www.blogmeetsworld.com/tag/find/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blogmeetsworld.com</link>
	<description>all the splinters of my mind</description>
	<lastBuildDate>Wed, 01 Feb 2012 20:38:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Linux Tip #1</title>
		<link>http://www.blogmeetsworld.com/linux-tip-1/</link>
		<comments>http://www.blogmeetsworld.com/linux-tip-1/#comments</comments>
		<pubDate>Tue, 12 May 2009 16:32:07 +0000</pubDate>
		<dc:creator>LRN</dc:creator>
				<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.blogmeetsworld.com/?p=238</guid>
		<description><![CDATA[<p>This one&#8217;s really basic, but just because you&#8217;re an ace php developer doesn&#8217;t necessarily mean you&#8217;ve had a chance to discover all the ins and outs of bash and the linux command line. One of the guys in the office recently asked me how to make a change to multiple files in his code base [...]</p><p><a href="http://www.blogmeetsworld.com/linux-tip-1/">Linux Tip #1</a></p>]]></description>
			<content:encoded><![CDATA[<p>This one&#8217;s really basic, but just because you&#8217;re an ace php developer doesn&#8217;t necessarily mean you&#8217;ve had a chance to discover all the ins and outs of bash and the linux command line. One of the guys in the office recently asked me how to make a change to multiple files in his code base with a single line command. Find and <a title="The sed FAQ" href="http://www.linuxtopia.org/online_books/linux_tool_guides/the_sed_faq/index.html" target="_blank">sed</a> are your friends here. Since I&#8217;m a huge fun of doing as many things as possible with one liners, here&#8217;s the gist of what we did.</p>
<p><code>find . -name '*.php' -exec sed -i -e"s#search#replace#g" {} \;</code></p>
<p>Find the files you want, run sed on each one of them, edit inline with the included expression, done.</p>
<p>Big thing to note is sed using &#8216;#&#8217; for a seperator and not &#8216;/&#8217; . I believe the man page still talks about using a forward slash, but &#8216;#&#8217; works.</p>
<p>The results from your find command are run through the {} so don&#8217;t forget that, and a find -exec must be terminated with a \;</p>
<p>Enjoy.</p>
<p><a href="http://www.blogmeetsworld.com/linux-tip-1/">Linux Tip #1</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.blogmeetsworld.com/linux-tip-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/9 queries in 0.138 seconds using disk: basic
Object Caching 419/432 objects using disk: basic

Served from: www.blogmeetsworld.com @ 2012-02-07 05:57:59 -->
