>_ linuxcommand.dev
Startseite grep
Text Processing

grep

Search for text patterns in files or input.

Syntax
$grep [OPTIONS] PATTERN [FILE...]
Examples
Examples
$grep 'pattern' file.txt
Examples
$grep -r 'text' /path/
Examples
$grep -i 'error' logfile
Shortcuts
grep -r 'pattern' . (recursive)
grep -v 'pattern' (invert match)
Typical use cases
Search text
grep 'text' file.txt
Case-insensitive
grep -i 'text' file.txt
Line numbers
grep -n 'text' file.txt
Note Essential for log analysis and filtering command output.
Export