From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 29 05:32:48 2006 Return-Path: X-Original-To: freebsd-hackers@FreeBSD.ORG Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B3F516A4DF for ; Tue, 29 Aug 2006 05:32:48 +0000 (UTC) (envelope-from rcoleman@criticalmagic.com) Received: from saturn.criticalmagic.com (saturn.criticalmagic.com [69.61.68.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05FB143D49 for ; Tue, 29 Aug 2006 05:32:47 +0000 (GMT) (envelope-from rcoleman@criticalmagic.com) Received: from [172.16.0.12] (adsl-074-229-078-253.sip.asm.bellsouth.net [74.229.78.253]) by saturn.criticalmagic.com (Postfix) with ESMTP id 0F5A03BD21; Tue, 29 Aug 2006 01:32:47 -0400 (EDT) Message-ID: <44F3D17E.6050405@criticalmagic.com> Date: Tue, 29 Aug 2006 01:32:46 -0400 From: Richard Coleman Organization: Critical Magic User-Agent: Thunderbird 1.5.0.5 (X11/20060823) MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.ORG, rick-freebsd@kiwi-computer.com, mlobo@digiart.art.br References: <200608281618.k7SGIwWh065261@lurza.secnetix.de> In-Reply-To: <200608281618.k7SGIwWh065261@lurza.secnetix.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: A handy utility (at least for me) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Aug 2006 05:32:48 -0000 Oliver Fromme wrote: > The following is probably the most efficient solution. > It doesn't run into all subdirectories (and works with > an arbitrary numebr of subdirectories). > > cd /usr/ports; echo */*/work | xargs rm -rf > > Best regards > Oliver > So does this: find /usr/ports -mindepth 3 -maxdepth 3 -name work -print -delete -prune I would be surprised if the globbing in most shells was more efficient than find. Although as mentioned before, nothing beats putting all the work directories in a single location, and using a single rm command. Richard Coleman rcoleman@criticalmagic.com