🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Linux Beginner

What is Grep?

A command-line utility for searching plain-text data for lines matching a regular expression pattern.

Grep (Global Regular Expression Print) is one of the most used Linux commands. Basic usage: grep "pattern" file. Common flags include -i (case insensitive), -r (recursive), -n (line numbers), -v (invert match), and -c (count).

Extended grep (grep -E or egrep) supports advanced regex. Grep is essential for log analysis, code searching, and text processing. Modern alternatives include ripgrep (rg) which is significantly faster.