[nycbug-talk] Deleting Lots of Files.

N.J. Thomas njt at ayvali.org
Wed Jun 21 11:25:22 EDT 2006


* Michael Hernandez <mhernandez at ocsny.com> [2006-06-21 11:08:19 -0400]:
> if you use a loop then rm will only get one argument at a time...
> for file in ./114*; do rm $file; done;

OP has *many* files in the dir in question. Deleting them using a for
loop forks off a separate process for each invocation of rm. This is
time consuming and unnecessary. xargs(1) is the way to go -- it was
designed for this sort of thing.

Thomas

-- 
N.J. Thomas
njt at ayvali.org
Etiamsi occiderit me, in ipso sperabo



More information about the talk mailing list