The other big gotcha that took a while to sink in was
find -name "foo*" -or -name "*bar" -print
which should actually be find \( -name "foo*" -or -name "*bar" \) -print
to do what you might expect (print things matching beginning with foo or ending with bar)Without the parens, it gets interpreted as
-name "foo*" -or ( -name "*bar" -and -print ),
and hence only prints things that match the latter predicate.Yes, well I know that now that I lost the contents of a project directory. Live and learn.
Both do what you expect once you understand `-name` and `-delete` are predicates (not switches) and find short-cuts.