Header Shadow Image


grep in windows with findstr

Life in Linux would be far more difficult without grep. So what's the equivalent in Windows?

C:\Users\tom>netstat -na|findstr 3389
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING
TCP [::]:3389 [::]:0 LISTENING

C:\Users\tom>

Very neat! But now how to alias this guy. Well, we can do this but it doesn't quite work in pipes:

C:\Users\tom>doskey grep=c:\windows\system32\findstr.exe $*

C:\Users\tom>doskey /macros
grep=c:\windows\system32\findstr.exe $*

C:\Users\tom>grep
FINDSTR: Bad command line

C:\Users\tom>

Have fun with that.

Cheers,
Tom

Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

     
  Copyright © 2003 - 2025 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License

 

0
Would love your thoughts, please comment.x
()
x
The IT Development and Technology Mini Vault | MicroDevSys.com
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.