I'm trying to process multiple lines and extract a specific list of IPs from the text file with a large list of IPs (10000-ips.txt)
.
To extract specific IPs from the file, I would normally use:
egrep '111.11.111.11|222.22.222.22' 10000-ips.txt
But now I have to filter about 5000 IP and not only two 111.11.111.11|222.22.222.22
but egrep return “Argument list too long”
Example:
egrep '5000-IPs-to-find' 10000-ips.txt
Return:
/usr/bin/egrep: Argument list too long
I like to know, what is the best way to do this?