A command-line search tool that finds patterns in text — short for Global Regular Expression Print

In simple terms: it hunts through files and tells you where the thing you’re looking for is hiding.
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

Explore MoT
RBCN 2026 image
Tue, 10 Feb
Where the Robot Framework community shines brightest.
MoT Software Testing Essentials Certificate image
Boost your career in software testing with the MoT Software Testing Essentials Certificate. Learn essential skills, from basic testing techniques to advanced risk analysis, crafted by industry experts.
Into The Motaverse image
Into the MoTaverse is a podcast by Ministry of Testing, hosted by Rosie Sherry, exploring the people, insights, and systems shaping quality in modern software teams.
Subscribe to our newsletter
We'll keep you up to date on all the testing trends.