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
AI Builders Workshop: A smart way to run AI-driven QA image
AI in QA shouldn’t mean more work to manage. Join us for this hands-on workshop where we show how to maximize the AI capabilities in QMetry and Reflect.
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.
This Week in Quality image
Debrief the week in Quality via a community radio show hosted by Simon Tomes and members of the community
Subscribe to our newsletter