$ grep -rn TODO src
$ grep -i --color needle file.txt
| -i | ignore case when matching |
| -v | invert — show lines that do NOT match |
| -r | search directories recursively |
| -R | search directories recursively, following symlinks |
| -n | prefix each match with its line number |
| -l | print only the names of files with matches |
| -L | print only the names of files with NO match |
| -c | print only a count of matching lines |
| -E | interpret the pattern as an extended regex |
| -F | match fixed strings, not regexes |
| -P | interpret the pattern as a Perl-compatible regex (PCRE) |
| -G | interpret the pattern as a basic regex (the default) |
| -o | print only the matched part of each line |
| -w | match whole words only |
| -x | match only whole lines |
| -I | skip binary files (treat them as non-matching) |
| -a | treat binary files as text |
| -H | print the file name with each match |
| -h | never print the file name with matches |
| -q | quiet — print nothing, exit 0 on the first match |
| -s | suppress error messages about unreadable files |
| -z | treat input and output as NUL-separated lines |
| -A | also print N lines after each match |
| -B | also print N lines before each match |
| -C | also print N lines of context around each match |
| -e | use the next argument as the pattern |
| -f | read patterns from the given file |
| --ignore-case | ignore case when matching |
| --invert-match | show lines that do NOT match |
| --recursive | search directories recursively |
| --line-number | prefix each match with its line number |
| --color | highlight matches in color |
| --include | only search files whose name matches this glob |
| --exclude | skip files whose name matches this glob |
| --exclude-dir | skip directories whose name matches this glob |
| --include-dir | only descend into directories matching this glob |
| --word-regexp | match whole words only |
| --fixed-strings | match fixed strings, not regexes |
| --files-with-matches | print only the names of files with matches |
| --count | print only a count of matching lines |
| --only-matching | print only the matched part of each line |
| --extended-regexp | interpret the pattern as an extended regex |
| --perl-regexp | interpret the pattern as a Perl-compatible regex |
| --quiet | quiet — print nothing, exit 0 on the first match |
| --no-filename | never print the file name with matches |
| --with-filename | print the file name with each match |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.