grep -q 'pattern' file.txt
Category: Text Processing
grep -q 'pattern' file.txt
Quiet mode — exit 0 if found, 1 if not (no output)
Runs silently — prints nothing, but exits with code 0 if the pattern was found or 1 if not. Used in scripts to test if a pattern exists.