On Tue Feb 09 1999 at 18:05, Jarkko Haapalainen wrote:
> > > >I was just wondering, how can I delete the .htaccess file from all the
> > > >sub-directories under the public_html dir. The directory structure is
> > > nested
> > > >to about 4-5 levels down and it is a pain going through 140 such main
> > > >directories. Is there a way of doing it or is there any script that will
> > > >allow me to delete recursively ?
> >
> > 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.
Cheers
Tony