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