Windows 相当于 Unix find 命令,用于搜索多种文件类型
虽然在 Windows 中安装了 cygwin 可以提供大部分 unix 命令,但我仍然想知道如何使用 Windows“查找”命令在一个命令中搜索多个文件类型。
即: 查找 . -name *.cpp -o -name *.h -o -name *.java
上面的命令给了我所有 cpp、h 和 cpp 的列表。 java,使用windows find相当于什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这将在当前工作目录和所有子目录中找到具有给定扩展名的所有文件:
请参阅 https://technet.microsoft.com/en-us/library/cc755121.aspx 了解有关使用
dir
的详细信息。This will locate all files with the given extensions in the current working directory and all subdirectories:
See https://technet.microsoft.com/en-us/library/cc755121.aspx for more info on using
dir
.findstr /p /s /i 。
上面的命令在当前目录和子目录中搜索给定的文本。
/n 也会打印行号。
findstr /p /s /i .
above command searches for the given text in current directories and sub directories.
/n will print the line numbers too.