Emulating Grep in Powershell. The option presented is to perform a grep on several files.

For a search in one file, with results going to output.txt

select-string -pattern "{pattern}" -caseSensitive c:\path\to\file.txt > output.txt

One note: The lines wrapped at the width of the command window, even when redirected to a file.


Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • StumbleUpon
  • Tumblr
  • TwitThis
  • FriendFeed
  • Netvibes
  • Ping.fm
  • Posterous
  • Technorati
  • Tipd
  • Twitter
  • Yahoo! Buzz