开发者

Windows equivalent for Unix find command to search multiple file types

开发者 https://www.devze.com 2023-03-11 19:15 出处:网络
While having a cygwin installed in win开发者_如何学Pythondows gives most of unix command, still i was wondering how to search multiple filetypes in one command using windows \"find\" command.

While having a cygwin installed in win开发者_如何学Pythondows 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?


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.


findstr /p /s /i .

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号