Marshall’s Weblog

Embiggen Your Mind

Marshall’s Weblog header image 2

Emulating Grep in Powershell

December 6th, 2007 · 11 Comments

Grep is one of my favorite tools to help me find something in a set of files. Since I cannot download Cygwin at work, I have to make due with what I have.

The following is a translation of grep -R "mypattern" *.cpp for Powershell.

gci C:\path\to\files\* --include *.cpp -recurse | select-string -pattern "mypattern" -caseSensitive

<sarcasm>
So much easier to remember…
</sarcasm>

Tags: General

11 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment