Re: A handy utility (at least for me)



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@xxxxxxxxxxxxxxxxx
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: xcopy cantt do /S
    ... | and look at the dates of the files in the subdirectories. ... | Regards, Paul R. Sadowski [MVP]. ... Prev by Date: ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: 100% pure Win32 IDE
    ... subdirectories) install of BDS? ...
    (borland.public.delphi.non-technical)
  • Finding all files in a directory
    ... What is the standard way in TCL to get a list of all files in a directory and its subdirectories? ... Regards, ...
    (comp.lang.tcl)
  • Newbie question about copy files
    ... Is it possible to copy a file from a root directory to all subdirectories at ... Regards, ... Robertico ...
    (comp.unix.bsd.freebsd.misc)