Online Linux Terminal Logo
OnlineLinuxTerminal
← All CommandsText Processing

$grep

Search for matching string patterns or regular expressions inside text files.

Sponsored AdvertisementAdSense Slot (banner)
Command Syntax
grep [OPTIONS] PATTERN [FILE...]

Try `grep` Live in Terminal

bash — terminal

Overview & Usage Details

Grep (Global Regular Expression Print) is the standard Unix search utility. It scans input lines matching a specified pattern and prints them to standard output.

Command Options & Flags

Option / FlagDescription
-iIgnore case distinctions in patterns and input files.
-nPrefix each line of output with its 1-based line number.
-vInvert match: select non-matching lines.
-cSuppress normal output and print a count of matching lines.
Sponsored AdvertisementAdSense Slot (leaderboard)