The Powershell equivalent to grep

I’m posting this mainly for my own use, since I keep forgetting the syntax. To search for a string in a source code tree, the command would look something like this:

Get-ChildItem -filter *.cs -recurse | Select-String -pattern "SearchTerm" -casesensitive

Plus or minus options, of course. You can also specify a base path for Get-ChildItem if required.

This entry was posted in Technology and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.