The find based methods in slashroot article are somewhat dubious. Firstly, -exec rm {} \; option will invoke rm for each and every file (also noted by the author). Gnu find offers a nifty feature for such occasions.

$ time find ./ -type f -exec rm {} \+
real    0m1.764s
Which builds up argument list, passing that to rm. It's more or less equivalent to the following (except there's no pipe/xargs involved):
$ time find ./ -type f -print0 | xargs -0 rm
real    0m1.321s

Using -delete:

$ time find ./ -type f -delete
real    0m0.795s

In parallel:

$ time find ./ -type f -print0 | xargs -0 -P4 -n10000 rm
real    0m0.571s

Perl versions:

$ time perl -e 'for(<*>){((stat)[9]<(unlink))}'
real    0m2.917s
$ time perl -e 'unlink for <*>'
real    0m2.308s

Tests were run in a tmpfs backed directory; files created as in the reference article:

$ for i in $(seq 1 500000); do echo testing >> $i.txt; done


In reply to Re: Oneliner magic to remove files by Anonymous Monk
in thread Onliner magic to remove files by glasswalk3r

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.