Just for the sake of documentation: you may have to dig deeper, as there are many search constellations (like me). It may turn out that prune is your friend, and -not -path will not do what you expect.
So, this is a valuable example of 15 search examples that exclude directories:
http://www.theunixschool.com/2012/07/find-command-15-examples-to-exclude.html
To relate the original question, the exception finally worked for me as follows:
find . -regex-type posix-extended -regex ".*def/incoming.*|.*456/incoming.*" -prune -o -print
Then, if you want to find one file and still exclude patterns, just add | grep myFile.txt | grep myFile.txt .
This may depend on your version of the search. I see:
$ find -version GNU find version 4.2.27 Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION SELINUX
peter_the_oak Aug 04 '14 at 7:15 2014-08-04 07:15
source share