Windows 相当于 Unix find 命令,用于搜索多种文件类型

发布于 2024-11-14 16:54:42 字数 216 浏览 10 评论 0原文

虽然在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一场信仰旅途 2024-11-21 16:54:42

这将在当前工作目录和所有子目录中找到具有给定扩展名的所有文件:

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

请参阅 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:

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

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

兔姬 2024-11-21 16:54:42

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文