On Wed Feb 10 1999 at 09:31, Tony Nugent wrote:

Just to revisit this to show another alternative...

> > > Try 'find ~/public_html -type f -name .htaccess -print|xargs rm -f'.
> >
> > Or..
> >     "rm -i `find ~/public_html -name .htaccess`"
> 
> No, using xargs is better as it parses one name at a time to rm.
> 
> This way, you might end up globbing too many filenames for rm to
> handle.  IIRC, it has a limit of 999 or something.  That's a lot, but
> it is a limit that I have had it reach on occasions.

This form is probably more "generic" across most unix platforms
(especially those that don't have the "xargs" utility from the gnu
findutils package available:

        find ~/public_html -name .htaccess -exec rm -i {} \;

Note that the curley brackets get substituted with each find, and
that the `;' needs to be escaped to protect it from the shell.

I'm not sure if there is a filename list limit doing it with -exec --
I suspect not as the exec'ed command is done per found filename, and
the man page for find doesn't mention one.  :)

Cheers
Tony

Reply via email to