fgrep
TLDR
Search for literal string
SYNOPSIS
fgrep [options] pattern [files...]
DESCRIPTION
fgrep searches for fixed strings rather than regular expressions. It's equivalent to grep -F and is faster when searching for literal text without regex metacharacters.
The tool treats the pattern as a plain string, so characters like ., *, and [ have no special meaning. This makes it ideal for searching log files, code, or any text containing regex metacharacters.
fgrep is particularly useful when the search pattern comes from user input or variables that might contain special characters.
PARAMETERS
PATTERN
Fixed string to search for.FILES
Files to search.-i, --ignore-case
Case insensitive matching.-n, --line-number
Show line numbers.-r, --recursive
Search directories recursively.-l, --files-with-matches
Show only filenames.-c, --count
Count matching lines.-v, --invert-match
Show non-matching lines.--help
Display help information.
CAVEATS
No regex support by design. Deprecated in favor of grep -F. Multiple patterns require -f option.
HISTORY
fgrep (fast grep) originated in Unix Version 7 as an optimized grep variant for literal strings. Modern implementations typically link to grep with the -F flag.


