LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 02-09-2004, 04:45 AM   #1
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Rep: Reputation: 30
grep [exact phrase]


I want grep to not be so general

eg more file.txt | grep 192.168.1.1
will find

192.168.1.1
192.168.1.12
192.168.1.121

etc... any way to make it ONLY do .1 and leave off the rest?

Chris
 
Old 02-09-2004, 05:16 AM   #2
nielchiano
Member
 
Registered: Feb 2004
Location: 50N 3E
Distribution: Gentoo
Posts: 64

Rep: Reputation: 15
tell it to search for "192.168.1.1{END OF LINE}"

grep "192.168.1.1$" file.txt
 
Old 02-09-2004, 05:30 AM   #3
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Original Poster
Rep: Reputation: 30
i got it to work using grep -w "192.168.1.1"

thanks anyways though
 
  


Reply


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
Start apache with the pass phrase DropHit Linux - Software 7 02-12-2010 04:36 PM
Which command to search text/phrase in file? b:z Linux - General 2 03-30-2005 10:11 PM
Search all man pages for a phrase suguru Linux - Software 1 09-12-2004 07:38 AM
pass phrase from disk in ppdd shashi_lq Linux - Security 1 04-18-2004 06:52 AM
grep a phrase degraffenried13 Linux - General 1 04-04-2004 12:10 PM


All times are GMT -5. The time now is 03:21 AM.

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