Is there a similar utility to grep
available from the Windows Command Prompt, or there is third party tool for it?
views:
3215answers:
18If you install either Cygwin or Mingw, then yes.
Otherwise, not as far as I know.
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.
PowerShell (included as standard on Windows 7/2008R2, optional for XP/2003/Vista/2008) which includes the select-string
cmdlet for this purpose.
UnxUtils is a great set of Unix utilites that run on Windows. It has grep, sed, gawk, etc.
If you don't mind a paid-for product, PowerGREP is my personal favorite.
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.
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.
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!
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.
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)
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.