Friday, November 2, 2007

Findstr to grep on Windows

If you've been using grep all week only to come home to an PC running Windows, you're probably missing a part of your life when you leave your Linux workstation.

If you've been in the dark on the Findstr command line utility for Windows, you'll certainly love my blog for this. If you're on a text file containing huge amounts of text, such as a log file (I've got a log4net log that generates a few hundred lines every hour... that is after disabling the memcache logging) you can get Findstr to search for all lines with a particular word. Findstr does regular expressions too. It's got many of the options that grep does - printing filenames for matches, printing lines that do not match, and multiple file search.

No comments: