grep
Installation
SKILL.md
grep
Search for patterns in files and streams. When ag is available, prefer it
for recursive searches — it is significantly faster, respects .gitignore
by default, and produces readable grouped output.
Quick Start
- Check if
agis available:command -v ag - If ag is available, use it for code/directory searches:
ag "pattern" . - Use
grepfor pipeline filtering and when ag is not present:grep "pattern" file
Intent Router
references/cheatsheet.md— grep and ag common flags, recursive search, context lines, invert match, and countreferences/advanced-usage.md— Extended and Perl regex, multiline matching, binary files, ag-specific features, and scripting patternsreferences/troubleshooting.md— Fixed-string vs regex, special character escaping, binary matches, and cross-platform differences