The man page for find(1)
says:
If the expression contains no actions other than
-prune
,
However, there seems to be a difference between these two expressions:
$ find . -path '*fo*' -prune -o -type f -print
./bar/xzyzzy
$ find . -path '*fo*' -prune -o -type f
./foo
./bar/xzyzzy
Why is ./foo
included in the output of the latter?
I created the example directory tree structure for the above with:
$ cd $(mktemp -d)
$ mkdir foo
$ mkdir bar
$ touch foo/quux
$ touch bar/xzyzzy
The output of find --version
for me is:
find (GNU findutils) 4.4.2`