什么是Windows的优秀grep工具? [关闭]
本文翻译自:What are good grep tools for Windows? [closed]
Any recommendations on grep tools for Windows? 有关Windows的grep工具的任何建议? Ideally ones that could leverage 64-bit OS. 理想情况下可以利用64位操作系统。
I'm aware of Cygwin , of course, and have also found PowerGREP , but I'm wondering if there are any hidden gems out there? 当然,我知道Cygwin ,并且还找到了PowerGREP ,但我想知道那里是否有任何隐藏的宝石?
#1楼
参考:https://stackoom.com/question/Mis/什么是Windows的优秀grep工具-关闭
#2楼
It's been a couple of years since you asked the question, but I'd recommend AstroGrep ( http://astrogrep.sourceforge.net ). 你问这个问题已经有几年了,但我推荐AstroGrep( http://astrogrep.sourceforge.net )。
It's free, open source, and has a simple interface. 它是免费的,开源的,并且具有简单的界面。 I use it to search code all the time. 我一直用它来搜索代码。
#3楼
GrepWin Free and open source (GPL) GrepWin免费开源(GPL)
I've been using grepWin which was written by one of the tortoisesvn guys. 我一直在使用grepWin,这是由一个tortoisesvn家伙写的。 Does the job on Windows... Windows上的工作是......
http://stefanstools.sourceforge.net/grepWin.html http://stefanstools.sourceforge.net/grepWin.html
#4楼
I used Borland's grep for years but just found a pattern that it won't match. 我使用Borland的grep多年,但只是发现了一个不匹配的模式。 Eeeks. Eeeks。 What else hasn't it found over the years? 多年来还发现了什么呢? I wrote a simple text search replacement that does recursion like grep - it's FS.EXE on source forge. 我写了一个简单的文本搜索替换,它像grep一样进行递归 - 它是source forge上的FS.EXE。
grep fails... grep失败了......
C:\DEV>GREP GAAPRNTR \SOURCE\TPALIB\*.PRG
<no results>
windows findstr works... windows findstr的作品......
C:\DEV>FINDSTR GAAPRNTR \SOURCE\TPALIB\*.PRG
\SOURCE\TPALIB\TPGAAUPD.PRG:ffSPOOL(cRPTFILE, MEM->GAAPRNTR, MEM->NETTYPE)
\SOURCE\TPALIB\TPPRINTR.PRG: AADD(mPRINTER, TPACONFG->GAAPRNTR)
\SOURCE\TPALIB\TPPRINTR.PRG: IF TRIM(TPACONFG->GAAPRNTR) <> TRIM(mPRINTER[2])
\SOURCE\TPALIB\TPPRINTR.PRG: REPLACE TPACONFG->GAAPRNTR WITH mPRINTER[2]
#5楼
PowerShell has been mentioned a few times. PowerShell已被提及几次。 Here is how you would actually use it in a grepish way: 以下是如何以实际的方式使用它:
Get-ChildItem -recurse -include *.txt | Select-String -CaseSensitive "SomeString"
It recursively searches all text files in the current directory tree for SomeString
with case sensitivity. 它递归搜索当前目录树中的所有文本文件,以区分大小写的SomeString
。
Even better, run this: 更好的是,运行这个:
function pgrep { param([string]$search, [string]$inc) Get-ChildItem -recurse -include $inc | Select-String -CaseSensitive $search }
Then do: 然后做:
pgrep SomeStringToSearch *.txt
Then to really make it magical, add the function alias to your PowerShell Profile and you can almost dull the pain of not having proper command line tools. 然后要真正使它变得神奇,将功能别名添加到PowerShell配置文件中 ,您几乎可以消除没有正确命令行工具的痛苦。
#6楼
dnGREP is an open source grep tool for Windows. dnGREP是Windows的开源grep工具。 It supports a number of cool features including: 它支持许多很酷的功能,包括:
- Undo for replace 撤消替换
- Ability to search by right clicking on folder in explorer 能够通过右键单击资源管理器中的文件夹进行搜索
- Advance search options such as phonetic search and xpath 提前搜索选项,如语音搜索和xpath
- Search inside PDF files, archives, and Word documents 在PDF文件,档案和Word文档中搜索
IMHO, it has a nice and clean interface too :) 恕我直言,它有一个漂亮和干净的界面:)