Search Text with Patterns
SH · Text Processingsyntax
grep [options] pattern [file...]example
grep -rn 'TODO' src/
grep -i 'error' /var/log/syslog
grep -c 'SELECT' queries.sql
grep -v '^#' nginx.confoutput
src/api/handler.go:42: // TODO: add rate limiting
src/lib/cache.ts:18: // TODO: implement TTLNote -r searches recursively through directories. -n shows line numbers. -i is case-insensitive. -v inverts the match (shows non-matching lines). -c counts matches. -l lists only filenames with matches. Use -E for extended regex or egrep.