Can I run this in a Windows command prompt like I can run it in UNIX?
egrep -wi 'FRIENDS|FOES' *.sql
This command is intended to scan each SQL file for the whole keywords "Friends" and "Foes," ignoring case.
Well you can have cygwin on Windows so then you have bash
, grep
, etc.
If you need only grep, then there is GnuWin32.
If you don't want to install anything and is on Win XP, try findstr
, although it can't do "orring".
If you are on Win-7, then there is powershell
, with select-string
.
I think the findstr
command is a fair enough substitute Windows command in place of Linux.
The Windows equivalent would be the FIND command:
C:\>find /? Searches for a text string in a file or files. FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]] /V Displays all lines NOT containing the specified string. /C Displays only the count of lines containing the string. /N Displays line numbers with the displayed lines. /I Ignores the case of characters when searching for the string. /OFF[LINE] Do not skip files with offline attribute set. "string" Specifies the text string to find. [drive:][path]filename Specifies a file or files to search. If a path is not specified, FIND searches the text typed at the prompt or piped from another command.
But you can also download most of the unix utilities (incl. grep) from http://gnuwin32.sourceforge.net/ (just drop them into your PATH and use them).
Depends on your system. Do you have some version of grep installed? Windows has no equvalent of grep out of the box, but you can install Cygwin / GnuWin or unxutils.sourceforge.net.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With