5

What is the best, free, grep application for use with Windows instead of Linux?

6 Answers6

7

You could also download Cygwin, which has a full Unix-style toolkit, including grep, AWK, and all the servers.

Rich Homolka
  • 32,350
5

Either use Grep for Windows or the findstr command suggested by Moron.

3

http://unxutils.sourceforge.net/ has a bunch of GNU tools ported to Windows.

3

Newer versions of Windows include a built-in grep, called findstr. It'll do just about whatever you need. For example

C:\>findstr /I windows c:\boot.ini
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professio
nal" /fastdetect /NOEXECUTE=ALWAYSON

For more info, just run findstr /? on a command prompt.

Aaron
  • 31
1

findstr is the "classic" solution, supporting some capability of regex matching but still significantly worse than grep because it lacks lots of regex operators and Unicode support

The modern solution is Select-String or its alias sls in PowerShell. It supports any regex features that the .NET framework supports. Due to the object-oriented nature of PowerShell, you can also achieve more things with it than grep, like customize the output

phuclv
  • 30,396
  • 15
  • 136
  • 260
0

I know this has been dormant, but I don't see very many options listed. I just came across AstroGrep referenced by twlichty at How to search inside files... and it works fine for me. As to "best", I think that is subjective, but I prefer command line grep and this is a GUI tool, but my preference is not enough to keep me looking...

sage
  • 1,227