views:

3215

answers:

18

Is there a similar utility to grep available from the Windows Command Prompt, or there is third party tool for it?

A: 

If you install either Cygwin or Mingw, then yes.

Otherwise, not as far as I know.

Jonathan Leffler
+19  A: 

Have fun

Gregor
+9  A: 

There is a command-line tool called FINDSTR that comes with all Windows NT-class operating systems (type FINDSTR /? into a Command Prompt window for more information) It doesn't support everything grep does but it might be sufficient for your needs.

Ken Keenan
+11  A: 

PowerShell (included as standard on Windows 7/2008R2, optional for XP/2003/Vista/2008) which includes the select-string cmdlet for this purpose.

Richard
+3  A: 

UnxUtils is a great set of Unix utilites that run on Windows. It has grep, sed, gawk, etc.

Andy White
A: 

Bare Grep is nice if you want a GUI. Gnu grep is good for CLI

Ariel
A: 

If you don't mind a paid-for product, PowerGREP is my personal favorite.

David Andres
A: 

We have recently used PowerGREP for some fairly advanced bulk operations on thousands of files. Including regex searching in content of PDF files, and altering PDF documents in largescale.

Its worth the money if you want to save time from manuel labour. You can try it before you buy i think.

Lars Udengaard
+5  A: 

Cygwin grep and more ;)

sdu
+3  A: 

Windows Grep

LRE
Great tool! Only short fall is the annoyingly small directory browser.
Michael Baker
That's not open-source or even free ...
Diaa Sami
was free last time I checked
LRE
also, where in the question is "Open Source" or "Free" a requirement
LRE
It may not be open source, but it is essentially free, from their download page: "A fully-functioning evaluation version is available for download. There are no differences between this and the registered version. It does not time-expire."
GreenMatt
It's not essentially free at all, and using it past the initial 30 days is wrong. Quote from http://www.wingrep.com/register.htm - `should you find it useful and use it beyond an initial evaluation period of 30 days you are both legally and morally obliged to pay the license fee.`
Dan Atkinson
A: 

If you have to use bare Windows, then in addition to the Powershell option noted above, you can use VBScript, which has decent RegEx support.

MS also has a decent scripting area on Technet with a ton of examples for administrators.

Ron Ruble
A: 

I'm surprised no one has mentioned FINDSTR. I'm no grep poweruser, but findstr does what I need it to, filter files and stdin, with some primitive regex support. Ships with Windows and all that. (Edit: Well someone did mention findstr, It's late I guess)

Svend
+4  A: 

GnuWin32 is worth mentioning, it provides native Win32 version of all standard linux tools, including grep, file, sed, groff, indent, etc.

And it's constantly updated when new versions of these tools are released.

Diaa Sami
A: 

In the windows reskit there is a utility called "qgrep". You may have it on your box already. ;-) It also comes with the "tail" command, thank god!

jskaggz
A: 

Although not technically grep nor command line, both Microsoft Visual Studio and Notepad++ have a very good Find in Files feature with full regular expression support. I find myself using them frequently even though I also have the CygWin version of grep available on the command line.

GBegen
A: 

Just try LikeGrep java utility. It may help you in very many cases. As you wish, it can also replace some text, found in files. It garantees its work on large files (up-to 8 Gb tested)

Igor
A: 

As mentioned above, the gnuwin32 project has a Windows CLI version of grep.

If you want something with a graphical interface, I would recommend the (open-source) tool AstroGrep.

bta
A: 

It has been a while since I've used them, but Borland (Embarcadero now) included a command line grep with their C/C++ compiler. For some time, they have made available their 5.5 version as a free download after registering.

GreenMatt