You can use find
in this short form:
find \( -name '*.cpp' -o -name '*.h' \) -print
-print
can be omitted. Using -o
just between expressions is especially useful when you want to find multiple types of files and do one same job (let's say calculating md5sum).