Match text literally instead of as a regex.
Section: Searching and Pattern Matching
Fixed-string search
bash
bash
grep -F 'user[id]' app.logExplanation
Use when the pattern contains regex metacharacters you want treated literally.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Searching and Pattern Matching
Search recursively under a directory
Search all matching files in a tree.
Fast recursive search with rg
Recursively search text quickly while respecting ignore rules.