What are good grep tools for Windows? [closed]

2019-01-01 14:04发布

Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS.

I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there?

标签: windows grep
28条回答
泛滥B
2楼-- · 2019-01-01 14:41

Well, beside the Windows port of the GNU grep at:

http://gnuwin32.sourceforge.net/

there's also Borland's grep (very similar to GNU one) available in the freeware Borland's Free C++ Compiler (it's a freeware with command line tools).

查看更多
流年柔荑漫光年
3楼-- · 2019-01-01 14:41

I wanted a free grep tool for Windows that allowed you to right click on a folder and do a regex search of every file - without any nag screen.

The following is a quick solution based on the findstr mentioned in a previous post.

Create a text file somewhere on your hard drive where you keep long lived tools. Rename to .bat or .cmd and paste the following into it:

@echo off
set /p term="Search term> "
del %temp%\grepresult.txt
findstr /i /S /R /n /C:"%term%" "%~1\*.*" > "%temp%\grepresult.txt"
start notepad "%temp%\grepresult.txt"

Then browse to the SendTo folder. On Windows 7 browse to %APPDATA%\Microsoft\Windows\SendTo and drag a shortcut of the batch file to that SendTo folder.

I renamed the shortcut to 1 GREP to keep it at the top of the SendTo list.

Things that I'd like to do next with this is pipe the output of findstr through something that would generate an html file so that you could click on each output line to open that file. Also, I don't think it works with shortcuts to folders. I'd have to inspect the parameter and see if it contains ".lnk".

查看更多
不流泪的眼
4楼-- · 2019-01-01 14:43

ack works well on Windows (if you've got Perl). I find it better than grep for many uses.

查看更多
还给你的自由
5楼-- · 2019-01-01 14:45

GREP for Windows

I've been using it forever and luckily it's still available. It's super fast and very small.

查看更多
登录 后发表回答