Friday, May 19, 2017

Multiple ways to get Grep and Curl for Windows




Download and install official curl for Windows



https://curl.haxx.se/dlwiz/?type=bin&os=Win64&flav=-&ver=*&cpu=x86_64




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 - unzip 
  2. curl.exe version: 7.54.0 - SSL enabled SSH enabled  - here unzip
    Provided by: Viktor Szakts

Copy into C:\Windows\System32

Run CMD.exe or open a command line windows

curl -I -s https://openedx.microsoft.com/


1
2
3
4
5
6
7
C:\Windows\system32>curl -I -s https://openedx.microsoft.com/
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 https://openedx.microsoft.com/  | grep -oP Server:.*

Full command line help documentation here for curl.


Get grep for Windows 


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.


Or you can get

Utilities and SDK for Subsystem for UNIX-based Applications in Microsoft Windows 7 and Windows Server 2008 R2

https://www.microsoft.com/en-us/download/details.aspx?id=2391
Complete Subsystem for UNIX-based Applications Overview here.

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

Choose

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

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.







No comments:

Post a Comment