Reputation: 221
I have to search for files with extension *.c or *.cpp or *.cc in a single find command using name. How to use an OR operator in find.?
find . -name '*.c' OR '*.cpp' OR '*.cc'
The exact syntax on how do i use it?
Upvotes: 1
Views: 95
Reputation: 15165
Group them with \( \)
(the slash is just to escape from the shell).
find . \( -iname bla -or -iname foo -or -name 'john dorian' \)
Upvotes: 1