fgrep

Matches patterns in files.

TLDR

Search for an exact string in a file

$ fgrep [search_string] [path/to/file]
copy

Search only lines that match entirely in files

$ fgrep -x [path/to/file1] [path/to/file2]
copy

Count the number of lines that match the given string in a file

$ fgrep -c [search_string] [path/to/file]
copy

Show the line number in the file along with the line matched

$ fgrep -n [search_string] [path/to/file]
copy

Display all lines except those that contain the given regular expression

$ fgrep -v [^regex$] [path/to/file]
copy

Display filenames whose content matchs the regular expression at least once

$ fgrep -l [^regex$] [path/to/file1] [path/to/file2]
copy

Copied to clipboard
free 100$ digital ocean credit