Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows equivalent for Unix find command to search multiple file types

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?

like image 653
Soumen Avatar asked Jun 08 '11 20:06

Soumen


People also ask

What is the equivalent of find command in Windows?

The rough equivalent to the Windows find is the Unix grep .

Which command is used to search for a file in Unix system?

Grep is a Linux / Unix command-line tool used to search for a string of characters in a specified file. The text search pattern is called a regular expression. When it finds a match, it prints the line with the result. The grep command is handy when searching through large log files.


1 Answers

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.

like image 191
JAB Avatar answered Oct 26 '22 08:10

JAB