GREP(1)
NAME
grep - print lines that match patterns
SYNOPSIS
grep [OPTIONS] PATTERN [FILE...]
DESCRIPTION
grep searches input files for lines that match a given pattern.
By default, it prints the matching lines to standard output.
Patterns are interpreted as basic regular expressions unless otherwise specified.
EXAMPLES
# Search for "error" in a file
grep "error" logfile.txt
# Case-insensitive search
grep -i "warning" logfile.txt
# Recursive search in a directory
grep -r "TODO" ./src
# Show line numbers
grep -n "main" program.c
EXIT STATUS
0 if a match is found, 1 if no matches are found, and 2 if an error occurred.
SEE ALSO
egrep, fgrep, sed, awk
AUTHOR
Originally written by GNU Project contributors.