Commands / Text and objects

Select-String

Search text like grep

beginner Text and objects Aliases sls

Select-String
 Select-String -Path .\docs\*.md -Pattern 'TODO'
Works on
WindowsLinuxmacOS
PowerShell
5.1 and later
Reference
Microsoft Learn: Select-String

This is grep. -Pattern can be a regex. -SimpleMatch treats it as literal text. -Path accepts wildcards. Pipeline input works too.

Try this

Select-String -Path .\docs\*.md -Pattern 'TODO' -SimpleMatch

Coming from another shell

ShellWhat you might type
bash / zshgrep -rn 'TODO' docs/
cmd.exefindstr /s /n TODO docs\*.md

More in From bash and From cmd.

Related commands