<p><pre><code>  &quot;Guess what &#x27;rm -rf *&#x27; does? That&#x27;s right, it expands
  the wildcard and tries to load the gigs and gigs of names
  of files into memory until it hits swap hell, but recursively.&quot;
</code></pre>
Why not go up to the parent directory and do &#x27;rm -rf <i>dirname</i>&#x27;? Then there&#x27;d be no wildcard to expand, and &#x27;rm&#x27; would just walk the directory removing one file at a time.