How to search for text inside files

Search file contents recursively with grep on Linux, findstr in CMD and Select-String in PowerShell — with context lines, exclusions and case-insensitive matching.

Beginner · about 5 min · Linux, Windows, macOS

Finding which config file sets a value, or which log line preceded a crash, is a content search rather than a filename search. Each platform has a native tool, and all three support recursion, case-insensitivity and context.

What this guide covers

Common pitfalls covered

Questions answered

This is a limited preview. The full walkthrough, command syntax and copy-ready examples are available to signed-in users.

Sign in to read the full page