From owner-freebsd-questions@FreeBSD.ORG Sun May 15 18:05:17 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A81F106564A for ; Sun, 15 May 2011 18:05:17 +0000 (UTC) (envelope-from listreader@lazlarlyricon.com) Received: from mailgw20.surf-town.net (mail11.surf-town.net [212.97.132.51]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC298FC18 for ; Sun, 15 May 2011 18:05:16 +0000 (UTC) Received: by mailgw20.surf-town.net (Postfix, from userid 65534) id 95F5361D6C; Sun, 15 May 2011 20:05:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mailgw20.surf-town.net (Postfix) with ESMTP id 6C69761D2E; Sun, 15 May 2011 20:05:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mailgw20.surf-town.net X-Spam-Flag: NO X-Spam-Score: -1.44 X-Spam-Level: X-Spam-Status: No, score=-1.44 tagged_above=-999 required=7 tests=[ALL_TRUSTED=-1.44] Received: from mailgw20.surf-town.net ([127.0.0.1]) by localhost (mailgw20.surf-town.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 8KZNakspqibF; Sun, 15 May 2011 20:05:09 +0200 (CEST) Received: from lazlar.kicks-ass.net (c-0987e355.09-42-6e6b7010.cust.bredbandsbolaget.se [85.227.135.9]) by mailgw20.surf-town.net (Postfix) with ESMTPA id A0FAC61DB4; Sun, 15 May 2011 20:05:07 +0200 (CEST) Message-ID: <4DD015D2.6070904@lazlarlyricon.com> Date: Sun, 15 May 2011 20:05:06 +0200 From: Rolf Nielsen User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; sv-SE; rv:1.9.2.17) Gecko/20110502 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: "Jack L. Stone" References: <3.0.1.32.20110515110806.0195b6e0@sage-american.com> <3.0.1.32.20110514171011.018a0598@sage-american.com> <3.0.1.32.20110515102740.0195b6e0@sage-american.com> <3.0.1.32.20110515110806.0195b6e0@sage-american.com> <3.0.1.32.20110515124117.0195b6e0@sage-american.com> <4DD01257.1070905@lazlarlyricon.com> In-Reply-To: <4DD01257.1070905@lazlarlyricon.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Eitan Adler , freebsd-questions@freebsd.org Subject: Re: find and remove ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2011 18:05:17 -0000 2011-05-15 19:50, Rolf Nielsen skrev: > 2011-05-15 19:41, Jack L. Stone skrev: >> At 12:19 PM 5/15/2011 -0400, Eitan Adler wrote: >>>> The comamnd: >>>> #find /path/to/start/deleting -type d -name _vti_\* >>>> worked fine to give the listing of what to delete, but when just >>>> adding the >>>> "-delete" at the end didn't delete, just ran the listing again. >>> >>> I forgot that adding the -type d won't let it delete non-empty >>> directories. Try running it like: >>> find /path/to/start/deleting -name _vti_\* -delete >>> >>>> >>>> (^_^) >>> >>> >> >> Nope. Thate didn't delete either. >> >> Jack >> >> (^_^) >> Happy trails, >> Jack L. Stone >> >> System Admin >> Sage-american >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to >> "freebsd-questions-unsubscribe@freebsd.org" >> > > > find /path/to/start/deleting -name _vti_\* -exec rm -Rd {} \; Pardon my answering my own post, but after reading the find manpage, I think perhaps find -d /path/to/start/deleting -type d -name _vti_\* -exec rm -Rd {} \; would be better. The -d option makes find visit the contents of a directory before the directory itself. The one without the -d option deletes the topmost directory it finds and then tries to traverse downwards, which of course causes a warning. It still works though.