Windows equivalent for Unix find command to search multiple file types

WindowsUnixCommand LineFindLs

Windows Problem Overview


While having a cygwin installed in windows gives most of unix command, still i was wondering how to search multiple filetypes in one command using windows "find" command.
ie: find . -name *.cpp -o -name *.h -o -name *.java

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

Windows Solutions


Solution 1 - Windows

This will locate all files with the given extensions in the current working directory and all subdirectories:

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

See https://technet.microsoft.com/en-us/library/cc755121.aspx for more info on using dir.

Solution 2 - Windows

findstr /p /s /i .

above command searches for the given text in current directories and sub directories. /n will print the line numbers too.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSoumenView Question on Stackoverflow
Solution 1 - WindowsJABView Answer on Stackoverflow
Solution 2 - WindowsSreedhar GSView Answer on Stackoverflow