A grep command to get all IP addresses contained in a text file
$ grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' IPs-To-Grep.txt > Grepped-ips.txt
egrep -o '[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+/[0-9]+' scope.txt > final-scope.txt
Last updated 2 years ago