Windows命令提示符中是否有与grep类似的实用程序,或者是否有第三方工具?


当前回答

我将把我的0.02美元添加到这个线程中。dnGREP是一个很棒的开源grep工具,它支持撤销,windows资源管理器集成,在pdf, zip, DOCs和其他一堆东西里面搜索…

其他回答

如果您不介意付费产品,PowerGREP是我个人的最爱。

我知道这是一个老问题,但我看到这个帖子寻求答案。我找到了一个,所以把它添加到这里,作为互联网的集体记忆

Powershell:选择string 模块: Microsoft.PowerShell.Utility

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string

以及一篇包含高级示例的内容丰富的博客文章:“如何在PowerShell中“grep”” https://antjanus.com/blog/web-development-tutorials/how-to-grep-in-powershell/

举个简单的例子: 猫包。选择字符串-模式webpack . json | ls ./src/components/ | Select-String -Pattern View

C:>猫帖。md | Select-String -Pattern "^\w*:"

Yes there is only one program for Windows PC which have solid GUI and it is essential util for me. I work as a developer and on every computer I've had, first thing install XFind program. It is created in 1997 and till now version is 1.0 and till now works and it is the best. Frequently I need to search some string in a ".cs", ".aspx", ".sct" (Visual FoxPro form code file) or just ".*" and XFind scans all files and show me files and another great thing is that you can look where string is in the file. XFind has also some kind of editor. If it binary file it will show you string finded. Try it and use it forever if you are developer like me.

使用Cygwin……

它有32位和64位版本 它在Windows 2000中工作良好(*) Windows 10或Server 2019

我用Cygwin很久了…… 最近尝试用windows - linux -子系统来替代…

不会太久…… 我很快又回到了Cygwin……

更加灵活、可控和丰富…… 也不那么打扰…

只需将\bin添加到路径… 你可以在Windows/Batch/Powershell中使用它… 或者在DOS-Box里…或者装在powershell盒子里…

你也可以安装很多很棒的软件包 这真的有用……比如nginX或PHP… 我甚至在我的IIS中使用Cygwin PHP包…

作为奖励,我们也可以在bash shell中使用它… (我认为这是最初的意图;-))

你显然收到了很多不同的推荐。 我个人选择一个免费的,第三方实用程序是:代理洗劫 Agent Ransack下载 尽管它的名字有点令人困惑,但它工作得很好,可以以各种方式使用它来查找文件。

祝你好运