I’ve just started playing with this, & so far it looks really neat-o: ngrep, which is short for network grep.
Here’s its description:
ngrep strives to provide most of GNU grep’s common features, applying them to the network layer. ngrep is a pcap-aware tool that will allow you to specify extended regular or hexadecimal expressions to match against data payloads of packets. It currently recognizes IPv4/6, TCP, UDP, ICMPv4/6, IGMP and Raw across Ethernet, PPP, SLIP, FDDI, Token Ring and null interfaces, and understands BPF filter logic in the same fashion as more common packet sniffing tools, such as tcpdump and snoop.
There are some nice examples provided on the webpage. For quick packet sniffing & network filtering,
ngrep looks nice.