🍺 BREW Explorer

← all formulae

grep

brew install grep v3.12 GPL-3.0-or-later

GNU pattern-matching command-line tool for searching text in files and streams.

Why you might care

The canonical line-search utility on Unix systems, supporting basic regex (grep), extended regex (egrep), and fixed strings (fgrep). Pre-installed on most systems, but Homebrew's formula offers the latest GNU version with PCRE2 support for more powerful pattern matching than BSD grep. Essential build dependency and universal shell script fallback.

Categories

Alternatives

ripgrep ag ack mawk
3.4k
30-day installs · #758
11.7k
90-day · #751
56.6k
365-day · #624

Runtime dependencies

Build dependencies

Links

Caveats

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"

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "ripgrep",
    "ag",
    "ack",
    "mawk"
  ],
  "build_dependencies": [
    "pkgconf"
  ],
  "categories": [
    "text-processor",
    "search"
  ],
  "caveats": "All commands have been installed with the prefix \"g\".\nIf you need to use these commands with their normal names, you\ncan add a \"gnubin\" directory to your PATH from your bashrc like:\n  PATH=\"$HOMEBREW_PREFIX/opt/grep/libexec/gnubin:$PATH\"\n",
  "conflicts_with": [],
  "dependencies": [
    "pcre2"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "GNU grep, egrep and fgrep",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:38:26+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "grep",
  "github_default_branch": null,
  "github_last_commit_at": null,
  "github_readme_excerpt": null,
  "github_repo": null,
  "github_stars": null,
  "github_topics": [],
  "homepage": "https://www.gnu.org/software/grep/",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": "Grep\n- GNU Project - Free Software Foundation",
  "installs_30d": 3372,
  "installs_365d": 56612,
  "installs_90d": 11668,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "GPL-3.0-or-later",
  "llm_generated_at": "2026-06-20T23:46:52+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "grep",
  "oldnames": [],
  "one_liner": "GNU pattern-matching command-line tool for searching text in files and streams.",
  "optional_dependencies": [],
  "rank_30d": 758,
  "rank_365d": 624,
  "rank_90d": 751,
  "raw_hash": "624d2a7cffeae65c",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/g/grep.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [],
  "version_head": "HEAD",
  "version_stable": "3.12",
  "versioned_formulae": [],
  "why_use_this": "The canonical line-search utility on Unix systems, supporting basic regex (grep), extended regex (egrep), and fixed strings (fgrep). Pre-installed on most systems, but Homebrew\u0027s formula offers the latest GNU version with PCRE2 support for more powerful pattern matching than BSD grep. Essential build dependency and universal shell script fallback."
}