I need to filter 5 IP addresses in a file. All *.tgz files.
Ip addresses are 10.85.1.1, 10.85.1.2, 10.85.1.3, 10.85.1.4, 10.85.1.5
I use this command:
zegrep -ai "10.85.1.[1-5]" *.tgz
This returns me also for example Ip 10.85.1.45. How do I tell the command that [1-5] is the end of my string?
I thought this would do the trick:
zegrep -ai '10.85.1.[1-5]$' *.tgz
But this returns me nothing. Still, this is possible so to double check my command I tried with Ip's that are in the file (I just took tail and took one of the latest Ip's that it returned).
zegrep -ai '10.85.1.1[5-6]$' *.tgz
This also returns nothing. So my command is still not correct.