grepip

Filters IPv4 and IPv6 addresses from text using grep-like syntax

brewmacoslinux
Try with needOr install directly
Source

About

Filters IPv4 & IPv6 addresses with a grep-compatible interface

Commands

grepip

Examples

Extract all IPv4 addresses from a file$ grepip -4 logfile.txt
Extract all IPv6 addresses from network output$ ifconfig | grepip -6
Find specific IP addresses matching a pattern$ grepip '192.168' access.log