# Install grepcidr with Homebrew, apt, dnf, MacPorts, Nix, zypper

Filter IP addresses matching IPv4 CIDR/network specification. Version 2.0 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:grepcidr
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install grepcidr
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install grepcidr
```

  Evidence: MacPorts ports tree: sysutils/grepcidr/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install grepcidr
```

  Evidence: Debian stable package indexes: grepcidr from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install grepcidr
```

  Evidence: Fedora Rawhide package metadata: grepcidr from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#grepcidr
```

  Evidence: nixpkgs package indexes: pkgs/by-name/gr/grepcidr/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install grepcidr
```

  Evidence: openSUSE Tumbleweed package metadata: grepcidr from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:grepcidr
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/grepcidr>
- **Version:** 2.0
- **Source summary:** Filter IP addresses matching IPv4 CIDR/network specification
- **Homepage:** <https://www.pc-tools.net/unix/grepcidr/>
- **Upstream docs:** <https://www.pc-tools.net/unix/grepcidr>
- **License:** GPL-2.0-or-later
- **Source archive:** <https://www.pc-tools.net/files/unix/grepcidr-2.0.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- grepcidr (cli)
- grepcidr (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.0
- Local data: ok
- Upstream repository: https://www.pc-tools.net/unix/grepcidr/
- info: No package-manager update timestamp was available.
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

grepcidr is a small C command-line filter for matching IPv4 and IPv6 addresses against CIDR patterns. It borrows grep's interface style for a networking-specific job: select or reject log lines by address range.

### Project history

Jem Berkes identifies the pc-tools.net grepcidr as the original project, created in 2004 and released as grepcidr 2.0 on 2014-05-26. The official page emphasizes that the 2.0 line is distinct from John Levine's separately developed fork, even though both names can confuse users.

Version 2.0 added IPv6 support, replaced a regex-based scanner with a hints scanner reported as faster on some platforms, enforced stricter IP text matching, added multiple file arguments, supported unlimited input line length, and improved CIDR validation.

### Adoption history

grepcidr's niche is operational networking: mail filtering, network security, log analysis, and custom pipelines where a full IP-address database or firewall tool would be too heavy. Its adoption in package managers follows from being a single-purpose Unix filter with no documented configuration or credential state.

### How it is used

The official examples show grepcidr matching an IPv6 documentation prefix against a log file and matching a Googlebot-era IPv4 CIDR range against access.log. Options include count output, inverted matching, strict CIDR alignment, strict start-of-line matching, command-line patterns, and pattern files.

### Why package nerds care

grepcidr is package-nerd significant because it is a tiny specialist filter that fills a gap between grep and heavier network-analysis tools. It lets shell users keep grep-like pipelines while making CIDR math correct enough for log and abuse workflows.

The official fork note matters for packaging: downstreams need to know whether they are shipping Berkes' grepcidr 2.0 line or Levine's unrelated implementation.

### Timeline

- 2004: Original grepcidr project created, according to the official project page.
- 2014: grepcidr 2.0 released with IPv6 support, faster scanning, stricter matching, and multiple-file support.
- 2014: Official page documented the distinction between Berkes' project and the separately developed grepcidr-2 fork.

### Related projects

- grep is the interface model for matching and inverted matching.
- John Levine's grepcidr-2 fork is called out by the official page as an unrelated implementation.
- Spamhaus is credited on the official page for sponsorship and testing of features.

### Sources

- <https://www.pc-tools.net/unix/grepcidr>


## Security Notes

broad file, network, media, or database tool signal.

- **Geiger risk:** blue / medium
- broad file, network, media, or database tool signal

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** grepcidr
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Debian apt - grepcidr - 2.0-2: normalized package name match | Debian stable package indexes: grepcidr from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Filter IP addresses matching IPv4/IPv6 CIDR/network specification | http://www.pc-tools.net/unix/grepcidr/
- Nix - grepcidr: normalized package name match | nixpkgs package indexes: pkgs/by-name/gr/grepcidr/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - grepcidr - 2.0-2: normalized package name match | Ubuntu 24.04 LTS package indexes: grepcidr from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Filter IP addresses matching IPv4/IPv6 CIDR/network specification | http://www.pc-tools.net/unix/grepcidr/
- dnf - grepcidr - 2.0-12.fc44: normalized package name match | Fedora Rawhide package metadata: grepcidr from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Filter IPv4 and IPv6 addresses matching CIDR patterns | https://www.pc-tools.net/unix/grepcidr/
- zypper - grepcidr - 2.0-2.6: normalized package name match | openSUSE Tumbleweed package metadata: grepcidr from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Filter IP addresses matching IPv4/IPv6 CIDR specification | http://www.pc-tools.net/unix/grepcidr/
- MacPorts - grepcidr: normalized package name match | MacPorts ports tree: sysutils/grepcidr/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Homebrew utility packages](https://www.automicvault.com/pkg/brew-utility-packages/) - Matched Homebrew package provider.
- [asn](https://www.automicvault.com/pkg/brew/asn/) - Popular package that depends on this formula.
- [grepip](https://www.automicvault.com/pkg/brew/grepip/) - Shares av.db curated category or tags: cli, ip-filtering, ip-tools, ipv4, networking.
- [cidr](https://www.automicvault.com/pkg/brew/cidr/) - Shares av.db curated category or tags: cidr, cli, networking.
- [cidr2range](https://www.automicvault.com/pkg/brew/cidr2range/) - Shares av.db curated category or tags: cidr, cli, networking.
- [cidrmerge](https://www.automicvault.com/pkg/brew/cidrmerge/) - Shares av.db curated category or tags: cidr, cli, networking.
- [iodine](https://www.automicvault.com/pkg/brew/iodine/) - Shares av.db curated category or tags: cli, ipv4, networking.
- [ipcalc](https://www.automicvault.com/pkg/brew/ipcalc/) - Shares av.db curated category or tags: cli, ip-tools, networking.
- [mapcidr](https://www.automicvault.com/pkg/brew/mapcidr/) - Shares av.db curated category or tags: cidr, cli, networking.
- [netaddr](https://www.automicvault.com/pkg/brew/netaddr/) - Shares av.db curated category or tags: cidr, cli, ipv4, networking.

## Combined YAML source

View the package source record on GitHub. [combined/grepcidr.yml](https://github.com/automic-vault/db/blob/main/combined/grepcidr.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
