Re: A handy utility (at least for me)
- From: Oliver Fromme <olli@xxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Aug 2006 12:49:41 +0200 (CEST)
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
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- Re: A handy utility (at least for me)
- From: Richard Coleman
- Re: A handy utility (at least for me)
- Prev by Date: Re: A handy utility (at least for me)
- Next by Date: Re: A handy utility (at least for me)
- Previous by thread: Re: A handy utility (at least for me)
- Next by thread: Re: A handy utility (at least for me)
- Index(es):
Relevant Pages
|
|