Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-13-2008, 10:28 AM   #1
Registered: Jan 2006
Location: Hellas, Europe
Distribution: Slackware 12
Posts: 238

Rep: Reputation: 32
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!
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-13-2008, 10:38 AM   #2
Registered: Jan 2006
Location: Hellas, Europe
Distribution: Slackware 12
Posts: 238

Original Poster
Rep: Reputation: 32

I should have read better the man page. The option -w seems to do the trick.
5 members found this post helpful.
Old 01-20-2014, 04:34 AM   #3
LQ Newbie
Registered: Jan 2014
Posts: 1

Rep: Reputation: Disabled

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


cat, string

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
grep exact letters packets Linux - Newbie 1 11-30-2007 08:39 PM
grep/sed/awk - find match, then match on next line gctaylor1 Programming 3 07-11-2007 08:55 AM
how to find an exact substring match? ldp Programming 7 02-22-2005 06:28 AM
grep [exact phrase] chrisfirestar Linux - General 2 02-09-2004 04:30 AM
how to grep only one string pr match gummimann Linux - General 3 11-06-2003 09:40 AM

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration