On 10/9/2011 3:52 AM, Ulrich Block wrote:
Am 09.10.2011 12:09, schrieb Chris Boot:
Slightly more efficient:

find public_html/tf2/tf/replays -mtime +7 -print0 | xargs -0 rm

HTH,
Chris


Or even  faster case it does not spawn "rm" for every file:
find public_html/tf2/tf/replays -mindepth 1 -mtime +7 -delete

Yours is the best solution, but the xargs solution (though less efficient, since it spawns extra processes) also wouldn't spawn "rm" for every file. If there are fewer than a few thousand files, it would likely end up being a single "rm"; if the concatenated names are longer than the shell will allow, xargs splits them up and uses more invocations as necessary. It's a pretty neat tool that is useful in many other circumstances.

-John

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to