grep

Install command:
brew install grep

GNU grep, egrep and fgrep

https://www.gnu.org/software/grep/

License: GPL-3.0-or-later

Development: Pull requests

Formula JSON API: /api/formula/grep.json

Formula code: grep.rb on GitHub

Bottle (binary package) installation support provided for:

macOS on
Apple Silicon
golden gate ✅
tahoe ✅
sequoia ✅
sonoma ✅
ventura ✅
macOS on
Intel
sonoma ✅
ventura ✅
Linux ARM64 ✅
x86_64 ✅

Current versions:

stable ✅ 3.12
head ⚡️ HEAD

Depends on:

pcre2 10.49 Perl compatible regular expressions library with a new API

Depends on when building from source:

pkgconf 3.0.10 Package compiler and linker metadata toolkit

Binaries: gegrep, gfgrep, ggrep

All commands have been installed with the prefix "g".
If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
    PATH="$HOMEBREW_PREFIX/opt/grep/libexec/gnubin:$PATH"

GitHub Packages downloads:

Last 30 days101,877
Downloads3,864,581
Analytics install events (30 days)3,336
Downloads / install events (30 days)30.5×

Source: GitHub Packages, fetched 2026-11-03T00:40:51Z. Analytics dates: 2026-10-04 to 2026-11-03. Totals exclude downloads from Bintray before the migration to GitHub Packages. Downloads and install attempts measure different things; the difference does not count analytics opt-outs. Definitions and limitations.

Analytics:

30 days90 days365 days
Installs3,3279,59248,015
Installs (--HEAD)91150
Installs on Request1,8886,06432,455
Installs on Request (--HEAD)91150
Build Errors (--HEAD)5