Re: leere verzeichnisse aus Shellskript löschen

From: Christian Weisgerber <naddy(at)>
Date: Mon, 14 Oct 2013 14:37:32 +0000 (UTC)

Oliver Fromme <olli(at)> wrote:

> Ja, und zum Glück hat BSD die "-delete"-Action von gnu-find
> "geklaut". Anderenfalls wäre es erheblich aufwendiger.

Für manche Werte von "BSD". OpenBSD find(1) kennt kein -delete.
Und ich kann find|xargs schwerlich als "aufwendig" empfinden.

"-delete" ist ein Hack, bei dem Vorsicht geboten ist:

   The -delete primary does not interact well with other options that cause
   the file system tree traversal options to be changed.

   Warnings: Don't forget that the find command line is evaluated
   as an expression, so putting -delete first will make find try to
   delete everything below the starting points you specified. When
   testing a find command line that you later intend to use with
   -delete, you should explicitly specify -depth in order to avoid
   later surprises. Because -delete implies -depth, you cannot
   usefully use -prune and -delete together.

Christian "naddy" Weisgerber                          naddy(at)
To Unsubscribe: send mail to majordomo(at)
with "unsubscribe de-bsd-questions" in the body of the message
Received on Mon 14 Oct 2013 - 16:37:41 CEST

search this site