<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" >
<channel>
<title>Entries tagged Linux</title>
<link>http://machineware.interspring.com/blog/tag/linux/index.html</link>
<description><![CDATA[]]></description>
<language>en</language>
<pubDate>Mon, 17 Mar 2008 18:52:39 +0000</pubDate>
<generator>interSpring.com</generator>
<image>
<title>Machineware, Web Application Development</title>
<url>http://machineware.interspring.com/g/machineware/feed.gif</url>
<link>http://machineware.interspring.com/blog/tag/linux/index.html</link>
<height>47</height>
<width>280</width>
</image>
<item>
<title>How to remove lots of files in a directory (Linux)</title>
<link>http://machineware.interspring.com/blog/how-to-remove-lots-of-files-in-a-directory-linux.html</link>
<guid isPermaLink="false">ZOYbxtLx</guid>
<description>&lt;p&gt;&lt;a href=&quot;http://spamassassin.apache.org/&quot;&gt;SpamAssasin&lt;/a&gt; uses a directory to store messages that it thinks are spam. After awhile this directory will be full of thousands (depending on the traffic through your mail server) of files. When I tried to delete these files using the command rm * -f&amp;nbsp; I got the message:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre&gt;
too many arguments
&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;I was able to get around this error by using:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;ls | xargs rm&amp;nbsp;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;The reason this works is because, well that's what xargs was designed to do (quoting from &lt;a href=&quot;http://www.linuxdevcenter.com/linux/cmd/cmd.csp?path=x/xargs&quot;&gt;Linux in a Nutshell&lt;/a&gt;):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Execute &lt;em&gt;command&lt;/em&gt; (with any initial arguments), but read remaining arguments from standard input instead of specifying them directly. &lt;strong&gt;xargs&lt;/strong&gt; passes these arguments in several bundles to &lt;em&gt;command&lt;/em&gt;, allowing &lt;em&gt;command&lt;/em&gt; to process more arguments than it could normally handle at once. The arguments are typically a long list of filenames (generated by &lt;strong&gt;ls&lt;/strong&gt; or &lt;strong&gt;find&lt;/strong&gt;, for example) that get passed to &lt;strong&gt;xargs&lt;/strong&gt; via a pipe.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;This has come in handy a few times.&lt;br /&gt;&lt;/p&gt;
</description>
<pubDate>Fri, 14 Sep 2007 23:17:31 +0000</pubDate>
<category>Linux</category>
</item>
</channel>
</rss>