I'm using GNU's find
.
I've simplified my problem to this shell session:
$ mkdir t
$ cd t
$ touch a
$ ln -s a b
$ find -type l
./b
$ find -type l -o -type f
./a
./b
$ find -type l -print
./b
$ find -type l -o -type f -print
./a
Maybe it's the fact that I'm very sleepy, but 2 things don't make sense to me:
- Isn't
true OR false == true
? How is it that adding-o -type f
causesfind
to stop matching./b
, despite-type l
matching? - The manual page says that
-print
is the default expression, so how is it that a file is printed when it's not mentioned, but omitted when it is?
This also happens when using -printf
(what I actually need); I imagine other expressions are affected, too.
find
with multiple-name
and-exec
executes only the last matches of-name
– ilkkachu Apr 18 '17 at 08:59