Grep is a command-line utility that can search and filter text using a common regular expression syntax, which explains why the word grep is sometimes used to simply mean “to search for”.
Grep finds all occurrences of a search term in a text file, a selection of files or the output of another command.
Examples
Return instances of the search term “Emily” in the provided file:
grep "Emily" ~/applicants.txt
Returns lines that do not contain “Referred by Emily”:
grep -v "Referred by Emily" ~/applicants.txt
Returns lines that do not contain “Referred by Emily” or “Referred by John M”:
grep -v -e "Referred by Emily" -e "Referred by John M" ~/applicants.txt