[NTLUG:Discuss] rm doesn't recurse
David White
davidnwhite at optusnet.com.au
Fri May 7 11:52:55 CDT 2004
> The method to avoid spawning thousands of rm's is to use find as:
>
> find . -type d -exec rm *.zip \;
Or just use the, imo simpler,
rm `find . -name "*.zip"`
That will only spawn one instance of 'rm', which will likely do a fairly
efficient loop over its arguments. There'll be a little cost in the shell
expansion, but not a big deal I don't think.
David
More information about the Discuss
mailing list