How to match files *.R and *Rd with find utility?

find, regex

Solution

Here you go =)

find -name "*.c" -o -name "*.R" -o -name "*.Rd"

If it's just the 3 extension types that you are looking for, I'd recommend staying away from regex and just using the `-o` (as in "or") operator to compose your search instead.

Problem

I would like to find all files that end with `.c`, `.R`, or `.Rd`. I tried ``` find . -iname "*.[cR]" -print ``` which gives all files that end with `.c` or `.R`. How can I additionally get `.Rd` files as well? I know that `[]` only matches one character, but I couldn't adjust it to provide `.Rd` files as well (tried to work with `|` or option `-regex` etc.)

Original source