<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: UNIX Find And Execute</title>
	<atom:link href="http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/</link>
	<description>because I don't believe in life before coffee...</description>
	<lastBuildDate>Wed, 23 Nov 2011 03:01:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Gerrit Griebel</title>
		<link>http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/comment-page-1/#comment-226029</link>
		<dc:creator>Gerrit Griebel</dc:creator>
		<pubDate>Wed, 27 Jun 2007 15:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/#comment-226029</guid>
		<description>Gnu find and xargs have a nice feature which helps when file names contain spaces: find . -name \*~ -print0 &#124; xargs -0 rm</description>
		<content:encoded><![CDATA[<p>Gnu find and xargs have a nice feature which helps when file names contain spaces: find . -name \*~ -print0 | xargs -0 rm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zach</title>
		<link>http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/comment-page-1/#comment-151052</link>
		<dc:creator>Zach</dc:creator>
		<pubDate>Fri, 13 Apr 2007 13:22:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/#comment-151052</guid>
		<description>In general this is what I find myself needing to do without GnuGrep&#039;s -r flag conveniently available on Solaris:

find . -exec grep -l &#039;a bit of text&#039; {} \;

This post has allowed me to recreate this about 20 times now, when I used to always ask you the syntax...</description>
		<content:encoded><![CDATA[<p>In general this is what I find myself needing to do without GnuGrep&#8217;s -r flag conveniently available on Solaris:</p>
<p>find . -exec grep -l &#8216;a bit of text&#8217; {} \;</p>
<p>This post has allowed me to recreate this about 20 times now, when I used to always ask you the syntax&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Komanec</title>
		<link>http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/comment-page-1/#comment-6230</link>
		<dc:creator>Erik Komanec</dc:creator>
		<pubDate>Thu, 19 Oct 2006 14:46:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/#comment-6230</guid>
		<description>Good tips, thank you.

Amazon have this book for better price.
http://www.amazon.com/Easy-Linux-Commands-Examples-Command/dp/0975913506/sr=8-1/qid=1161269074/ref=pd_bbs_sr_1/002-2287464-9167267?ie=UTF8</description>
		<content:encoded><![CDATA[<p>Good tips, thank you.</p>
<p>Amazon have this book for better price.<br />
<a href="http://www.amazon.com/Easy-Linux-Commands-Examples-Command/dp/0975913506/sr=8-1/qid=1161269074/ref=pd_bbs_sr_1/002-2287464-9167267?ie=UTF8" rel="nofollow">http://www.amazon.com/Easy-Linux-Commands-Examples-Command/dp/0975913506/sr=8-1/qid=1161269074/ref=pd_bbs_sr_1/002-2287464-9167267?ie=UTF8</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/comment-page-1/#comment-642</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 10 May 2006 12:51:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/#comment-642</guid>
		<description>Good tip Peter!

Usually when I&#039;m doing stuff like this I&#039;m not too worried about performance (kick it off and walk away), but your right.  xargs could save big on a large find.

Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Good tip Peter!</p>
<p>Usually when I&#8217;m doing stuff like this I&#8217;m not too worried about performance (kick it off and walk away), but your right.  xargs could save big on a large find.</p>
<p>Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/comment-page-1/#comment-637</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 10 May 2006 03:55:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.lifeaftercoffee.com/2006/05/09/unix-find-and-execute/#comment-637</guid>
		<description>Just remeber that exec creates [fork(2)] one process per file. if the cmd in can accept multiple arguments, then xargs will provide better performance.

Simple exmaple, lets say you have a tree of files with emacs backup files scattered thought out, lets say there are 100 of them in total.

find . -name \*~ -exec rm {} \;

The above will remove them, but 100 rm processes will be created in addition to the single find process. Process creation is a _relatively_ slow operation, process to create, new command to load, dymanic libraries to load and initialise, etc...

find . -name \*~ -print &#124; xargs rm

This will do the same job but only create one (or maybe a few more) rm processes.
xargs(1) as describe in the manual page contructs cmd lines and execute them, it knows the max cmd line length and will only create additional cmdlines to execute if the  cmd line its creating gets too long. So the process count here is find + xargs + rm * N where N will be most likely be </description>
		<content:encoded><![CDATA[<p>Just remeber that exec creates [fork(2)] one process per file. if the cmd in can accept multiple arguments, then xargs will provide better performance.</p>
<p>Simple exmaple, lets say you have a tree of files with emacs backup files scattered thought out, lets say there are 100 of them in total.</p>
<p>find . -name \*~ -exec rm {} \;</p>
<p>The above will remove them, but 100 rm processes will be created in addition to the single find process. Process creation is a _relatively_ slow operation, process to create, new command to load, dymanic libraries to load and initialise, etc&#8230;</p>
<p>find . -name \*~ -print | xargs rm</p>
<p>This will do the same job but only create one (or maybe a few more) rm processes.<br />
xargs(1) as describe in the manual page contructs cmd lines and execute them, it knows the max cmd line length and will only create additional cmdlines to execute if the  cmd line its creating gets too long. So the process count here is find + xargs + rm * N where N will be most likely be</p>
]]></content:encoded>
	</item>
</channel>
</rss>

