Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

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.
0
MDarling
Asked:
MDarling
1 Solution
 
IainHereCommented:
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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now