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


当前回答

我很惊讶没有人提到FINDSTR。我不是grep poweruser,但findstr做什么我需要它,过滤文件和stdin,与一些基本的正则表达式支持。装有Windows系统的船。(编辑:嗯,有人提到了findstr,我猜是晚了)

其他回答

更新:最初问这个问题的时候不是这样的,但是现在微软允许为Linux安装Windows子系统,然后Windows将运行grep。在PowerShell中运行:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

PowerShell(在Windows 7/2008R2中作为标准包含,在XP/2003/Vista/2008中是可选的),它为此目的包含了select-string cmdlet。

Oak Road Systems提供了一个商业grep实用程序。

所有Windows nt类操作系统都有一个名为FINDSTR的命令行工具(FINDSTR /?它不支持grep所做的一切,但它可能足以满足您的需求。

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.