Skip to content

Instantly share code, notes, and snippets.

@plathrop
Created March 19, 2014 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plathrop/9649245 to your computer and use it in GitHub Desktop.
Save plathrop/9649245 to your computer and use it in GitHub Desktop.
-delete
Delete files; true if removal succeeded. If the removal failed, an error message is issued. If -delete fails, find's exit status will be nonzero (when it eventually exits). Use of
-delete automatically turns on the -depth option.
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 speci‐
fied. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment