grep question - match exact string
Hi all,
I have a file with a list of IP addresses. For instance: 192.168.10.5 192.168.10.15 192.168.10.16 192.168.10.155 .... I want to run grep over it and get as a result only the second one, 192.168.10.15: Code:
grep 192.168.123.15 ~/ip_list How can I match only the .15 IP? I tried a few things while googling but no luck. Thanks a lot in advance! |
SOLVED.
I should have read better the man page. The option -w seems to do the trick. |
"grep -Fx 192.168.123.15 ip_list" or "cat as |grep -Fx 192.168.10.15"
|
All times are GMT -5. The time now is 11:28 PM. |