# ngrep

> grep applied to the network layer

Source: https://talira.ai/catalog/ngrep-qk1tdraf
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool
- Categories: [networking / packet analysis](https://talira.ai/categories/networking/packet-analysis)
- Platforms: linux, macos, windows, docker, cli[^3][^5]
- Licence: ngrep License (BSD-style, with an advertising clause)[^3][^4]
- Pricing: Free and open source[^3]
- Free tier: yes[^3]
- Self-hostable: yes[^3]
- Creator: Jordan Ritter

ngrep (network grep) is like GNU grep applied to the network layer: it captures packets through [libpcap](https://talira.ai/catalog/libpcap-qt4dvtby.md) and matches their payloads against an extended regular expression or a hex pattern, using the same BPF filter syntax as [tcpdump](https://talira.ai/catalog/tcpdump-1mt2hf7k.md). It understands IPv4 and IPv6, TCP, UDP, ICMP, IGMP and raw packets on many interface types, prints matching packets as text (UTF-8 too), and reads and writes pcap files. It was made for debugging plaintext protocols such as HTTP, IMAP, DNS and SIP and for spotting unusual traffic, and version 1.49.0 (February 2026) resolves [Docker](https://talira.ai/catalog/docker-engine-9442r3nw.md) and [Podman](https://talira.ai/catalog/podman-dsk3mjnr.md) container names. Written in C by Jordan Ritter, with release binaries for Linux, [macOS](https://talira.ai/catalog/macos-8swyggxb.md), the BSDs, Solaris and Windows and an image on [GitHub](https://talira.ai/catalog/github-ppcgj756.md)'s container registry, under a BSD-style licence (GPL when built against GNU regex instead of PCRE2).

## Links

- GitHub: https://github.com/jpr5/ngrep
- Docs: https://github.com/jpr5/ngrep/blob/master/EXAMPLES.md

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/ngrep>[^1]
- [APT](https://talira.ai/catalog/apt-d7essv0z.md): <https://packages.debian.org/stable/ngrep>[^2]

## Problems it solves

- grep live network traffic for a string the way grep searches files
- see which HTTP requests reach my server matching a URL pattern, without a proxy
- watch SIP messages on a VoIP server to debug call setup
- search a saved pcap file for packets whose payload matches a regex or hex bytes
- find which container on a Docker host is sending a particular request
- spot traffic whose payload matches a malware pattern on the wire
- print packet payloads as readable text instead of a hex dump
- debug a plaintext protocol exchange like IMAP or DNS by watching the packets

## Features

- regex (PCRE2 or GNU regex) and hex pattern matching on packet payloads
- BPF filter expressions like tcpdump
- IPv4/6, TCP, UDP, ICMPv4/6, IGMP and raw packets
- reads and writes pcap files
- UTF-8 payload display
- Docker and Podman container name resolution (-r)
- tcpkill-style connection killing (optional build)
- binaries for Linux, macOS, FreeBSD, NetBSD, OpenBSD, Solaris and Windows; Docker image

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.28 out of 1.
Signals: backing 0.20, extensibility 0.20.

- created by Jordan Ritter

Warnings:

- GitHub activity not fetched yet

## Related

- Based on [libpcap](https://talira.ai/catalog/libpcap-qt4dvtby.md)

## Alternatives

- [tcpdump](https://talira.ai/catalog/tcpdump-1mt2hf7k.md): A powerful command-line packet analyzer
- [Wireshark](https://talira.ai/catalog/wireshark-h4r9pgqd.md): The world's leading network protocol analyzer
- [Termshark](https://talira.ai/catalog/termshark-6pknqzv3.md): A terminal UI for tshark, inspired by Wireshark

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
[^2]: https://deb.debian.org/debian/dists/stable/main/source/Sources.xz (checked 21 Nov 2026)
[^3]: https://github.com/jpr5/ngrep (checked 20 Nov 2026)
[^4]: https://github.com/jpr5/ngrep/blob/master/LICENSE (checked 20 Nov 2026)
[^5]: https://github.com/jpr5/ngrep/releases (checked 20 Nov 2026)
