Is this expected behaviour ? It seems odd to me. (01:47:44:davej@nwo:tmp)$ touch a.c (01:47:47:davej@nwo:tmp)$ touch a.h (01:47:48:davej@nwo:tmp)$ ls *.c *.h a.c a.h (01:47:52:davej@nwo:tmp)$ find . -name "*.c" -o -name "*.h" ./a.c ./a.h (01:48:04:davej@nwo:tmp)$ find . -name "*.c" -o -name "*.h" -print ./a.h (01:48:06:davej@nwo:tmp)$
Yes, that's correct: find . -name "*.c" -o -name "*.h" is equivalent to find . \( -name "*.c" -o -name "*.h" \) -print OTOH find . -name "*.c" -o -name "*.h" -print is find . -name "*.c" -o -name "*.h" -a -print which is find . -name "*.c" -o \( -name "*.h" -a -print \)