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


当前回答

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

其他回答

如上所述,gnuwin32项目有一个Windows CLI版本的grep。

如果你想要图形界面,我会推荐(开源)工具AstroGrep。

UnxUtils是一组运行在Windows上的Unix实用程序。它有grep, sed, gawk等。

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

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*:"

其中,一体化的busybox包含grep / egrep / sed / awk等

从下面得到:

http://frippery.org/busybox/index.html http://frippery.org/files/busybox/?C=M;O=D

更新:不再可用-或一些旧的

https://github.com/pclouds/busybox-w32

如果你想要一个GUI, Bare Grep是不错的选择。Gnu grep适合CLI