Date: Tue, 29 Aug 2006 12:49:41 +0200 (CEST) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-hackers@freebsd.org, rick-freebsd@kiwi-computer.com, mlobo@digiart.art.br, rcoleman@criticalmagic.com Subject: Re: A handy utility (at least for me) Message-ID: <200608291049.k7TAnf1h009695@lurza.secnetix.de> In-Reply-To: <44F3D17E.6050405@criticalmagic.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Richard Coleman wrote: > 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 > > 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. Both are mainly disk-bound, so the runtime should be about the same, I guess. (I'm too lazy to do any actual bench- marks with find and various shells.) > Although as mentioned before, nothing beats putting all the work > directories in a single location, and using a single rm command. Yes, there is something that beats it: If you put the work directories on their own filesystem, you can simply umount and newfs it, which is probably faster than rm -rf. If you use a memory filesystem (md device), it's even sufficient to just umount it. I think nothing beats that in terms of speed. ;-) Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. $ dd if=/dev/urandom of=test.pl count=1 $ file test.pl test.pl: perl script text executable
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608291049.k7TAnf1h009695>