regex question

I want to find all the .c, .h, and .cpp files in a directory tree.  I can find all the .c and .h files by using the following...

find . -name "*\.[ch]"

how do i modify this to find the .cpp files as well?

Thanks,
Mike.
LVL 3
MDarlingAsked:
Who is Participating?
 
IainHereConnect With a Mentor Commented:
find . -name "*\.[ch]" -o -name "*.cpp"

o is for or.  You can use -or on some systems if you want.
0
 
MDarlingAuthor Commented:
Thanks Iain.  Just the job!

Regards,
Mike.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.