<?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>Personal Blog of Emre Yaşar &#187; find -exec</title>
	<atom:link href="http://www.yasars.com/index.php/tag/find-exec/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yasars.com</link>
	<description>A bit technical, a bit lifestyle..</description>
	<lastBuildDate>Tue, 27 Apr 2010 19:55:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Basic Linux Tips #1 &#8211; Argument list too long -</title>
		<link>http://www.yasars.com/index.php/2009/11/20/basic-linux-tips-1-argument-list-too-long/</link>
		<comments>http://www.yasars.com/index.php/2009/11/20/basic-linux-tips-1-argument-list-too-long/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 11:14:18 +0000</pubDate>
		<dc:creator>Admin - Emre Yasar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Argument list too long]]></category>
		<category><![CDATA[basic linux tips]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[find -exec]]></category>

		<guid isPermaLink="false">http://www.yasars.com/?p=325</guid>
		<description><![CDATA[If you are getting an error message as &#8220;Argument list too long&#8221; while attempting to run a command at Linux shell &#8220;find&#8221; command will be your lifeguard.
This error message tells you, the directory you are trying to work contains a huge number of files. That&#8217;s why the shell can not handle this operation.
Solution is simple. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-8" title="LINUX1-emreyasar" src="http://www.yasars.com/wp-content/uploads/2009/08/LINUX1-full-300x187.jpg" alt="LINUX1-emreyasar" width="300" height="187" />If you are getting an error message as &#8220;<span style="text-decoration: underline;">Argument list too long</span>&#8221; while attempting to run a command at Linux shell <span style="text-decoration: underline;">&#8220;find&#8221;</span> command will be your lifeguard.</p>
<p>This error message tells you, the directory you are trying to work contains a huge number of files. That&#8217;s why the shell can not handle this operation.</p>
<p>Solution is simple. Try taking to pieces your batch. For instance try running <strong>cp conf*.txt /tmp</strong> instead of using <strong>cp * /tmp</strong></p>
<p>If you can&#8217;t group the files as above you may use find command with <span style="text-decoration: underline;">exec </span>option.</p>
<p><span id="more-325"></span></p>
<p><strong>emreyasar@testserver:~&gt; cp /srv/www/htdocs/cacti/rra/* /tmp/<br />
-bash: /bin/cp: Argument list too long</strong></p>
<p>At this situation this command will do what you are trying to do:</p>
<p><strong>emreyasar@testserver:~&gt; find /srv/www/htdocs/cacti/rra -name &#8220;*&#8221; -exec cp {} /tmp \; </strong></p>
<p>You will like using find command with exec option.</p>
<p>It may simplify your works so many times.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yasars.com/index.php/2009/11/20/basic-linux-tips-1-argument-list-too-long/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

