plan9-grep.1 -oP '\d+\.\d+\.\d+\.\d+(\/.\d+|)' file_with_ips
search a file for a pattern
source manpages: plan9-grep