Windows equivalent for Unix search command to search multiple file types

Although having cygwin installed on Windows gives most of the unix command, I was still wondering how to search for multiple file types in a single command using the Windows find command.
i.e.: find . -name *.cpp -o -name *.h -o -name *.java find . -name *.cpp -o -name *.h -o -name *.java

The above command gives me a list of all cpp, h and java, what would be equivalent using find windows?

+68
command-line windows unix find ls
Jun 08 2018-11-11T00:
source share
2 answers

This will detect all files with the specified extensions in the current working directory and in all subdirectories:

 dir *.cpp *.h *.java /b/s 

For more information on using dir see https://technet.microsoft.com/en-us/library/cc755121.aspx .

+95
Jun 08 '11 at 20:59
source share

findstr / p / s / i.

the command searches for the given text in the current directories and subdirectories. / n will also print line numbers.

-3
Sep 10 '14 at 9:36 on
source share



All Articles