Friday, May 19, 2017

Multiple ways to get Grep and Curl for Windows

Getting CURL for Windows

Download and install official curl for Windows

Choose latest version, and you want SSH enabled as well

curl version: 7.54.0 - SSL enabled SSH enabled
(was latest version as of publishing of this article).

For windows

  1. curl.exe version: 7.54.0 - SSL enabled - here 
  2. curl.exe version: 7.54.0 - SSL enabled SSH enabled  - here 
    Provided by: Viktor Szakts

Copy into C:\Windows\System32

Run CMD.exe or open a command line windows

curl -I -s

C:\Windows\system32>curl -I -s
HTTP/1.1 500 Internal Server Error
Server: nginx
Date: Mon, 08 May 2017 22:07:54 GMT
Content-Type: text/html
Content-Length: 134
Connection: keep-alive

Line 3 Server : nginx is server manufacturer. 

Or for just the Server name

curl -I -s  | grep -oP Server:.*

Full command line help documentation here for curl.

Get grep for Windows 

1) Official GNU Port

Grep for Windows ( - was dubious in the past, check 

Cygwin - large install 
2) You can get GNUwin32 Grep for Windows, grep.exe version is 2.5.4 here , a little old give that grep 3.0 is officially out. But it comes with an installer and easy to use.

For the latest grep 3.0 you'll have to get Cygwin, but be careful on how you install it.

The default bare bones Cygwin install is 101 MB, but for other packages the full installation can reach 114 Gb.

3) Utilities and SDK for Subsystem for UNIX-based Applications in Microsoft Windows 7 and Windows Server 2008 R2 - can extra only grep cmd
Complete Subsystem for UNIX-based Applications Overview here.

Download here for Windows x32 or x64 or Windows Features in Windows 7.


Utilities and SDK for Subsystem for UNIX-based Applications_X86.exe and unzip.

in the following directory you can find grep.exe and run it from there

.\Utilities and SDK for Subsystem for UNIX-based Applications_X86\BaseUtils\common

Or install the entire thing.

Windows Server 2003 Resource Kit Tools

4) Download here, and is a much smaller compact install than Subsystem for UNIX (above).

Tip: Go with this.
Note: grep.exe is replaced by Microsoft® Quick Grep qgrep.exe

Online help for qqrep.exe

List and online help for all Resource Toolkit here.

Resource Toolkit also contains head.exe, tail.exe and touch.exe, Duplicate File Finder (dupfinder.exe), File Locator (where.exe) like unix find analog. Brief description of top Resource Toolkit utilities here.

Get GUI grep for Windows 
1) grepWin - is a GUI version but very fast, get it from the source on Github.

No comments:

Post a Comment