-   Linux - General (
-   -   grep question - match exact string (

Panagiotis_IOA 02-13-2008 11:28 AM

grep question - match exact string
Hi all,

I have a file with a list of IP addresses. For instance:

I want to run grep over it and get as a result only the second one,


grep ~/ip_list
The result is that I get both and

How can I match only the .15 IP? I tried a few things while googling but no luck.

Thanks a lot in advance!

Panagiotis_IOA 02-13-2008 11:38 AM


I should have read better the man page. The option -w seems to do the trick.

shaileshmshinde 01-20-2014 05:34 AM

"grep -Fx ip_list" or "cat as |grep -Fx"

All times are GMT -5. The time now is 05:24 AM.