BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Hi, how to delete several files in a recursive way
- Subject: Hi, how to delete several files in a recursive way
- From: david-8uUts6sDVDvs2Lz0fTdYFQ at public.gmane.org (David Kramer)
- Date: Mon, 01 Mar 2010 01:32:19 -0500
- In-reply-to: <4B8B5C5D.2000200-KCgK2vT7wad/90uGnh1m2w@public.gmane.org>
- References: <128afb401002282208ja65aa31m12ce2533e6379c48@mail.gmail.com> <4B8B5C5D.2000200@code-energy.com>
Cole Tuininga wrote:
> Franco castro wrote:
>> Hi, I need to delete all .htaccess in all folders, but we are talking about
>> houndreds of folders, I need to figuer out how to "find and destroy" delete
>> all those files, I'm not very good with bin bash scripting, so maybe any of
>> yours know how to do it, tnks =)
>
> How about something along the lines of:
>
> find /path/to/base/dir -name .htaccess -exec rm -i {} \;
>
> If you're brave, you can change the -i to -f to make it not ask you
> about each and every file, but that sounds dangerous to me...
Sorry I didn't see your reply before sending mine. I would NOT do it
that way, because you're launching a shell for each file found. I
suggested:
find /srv/www -name .htaccess -delete
However, if you're paranoid, back them up like this first:
tar cvzf /tmp/htaccessfiles.tgz `find /srv/www -name .htaccess`
- References:
- Hi, how to delete several files in a recursive way
- From: latinos986-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org (Franco castro)
- Hi, how to delete several files in a recursive way
- From: colet-KCgK2vT7wad/90uGnh1m2w at public.gmane.org (Cole Tuininga)
- Hi, how to delete several files in a recursive way
- Prev by Date: Hi, how to delete several files in a recursive way
- Next by Date: What do you use for apache log statistics
- Previous by thread: Hi, how to delete several files in a recursive way
- Next by thread: Hi, how to delete several files in a recursive way
- Index(es):
