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 03-29-2008, 09:17 PM   #1
Registered: Oct 2001
Distribution: Ubuntu 9.10
Posts: 148

Rep: Reputation: 15
find exact phrase

I'm having trouble figuring out how to use find to find an exact phrase within files, and not something that is a part of another word. For instance, searching for var, I would not want variable to match.
Old 03-29-2008, 09:28 PM   #2
HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 74
grep '\bvar\b'


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
find the exact location of a running exec file cahdecah General 4 08-16-2007 11:53 AM
Find/locate an exact file stefaandk Linux - General 2 12-27-2005 08:56 AM
how to find an exact substring match? ldp Programming 7 02-22-2005 07:28 AM
grep a phrase degraffenried13 Linux - General 1 04-04-2004 12:10 PM
grep [exact phrase] chrisfirestar Linux - General 2 02-09-2004 05:30 AM

All times are GMT -5. The time now is 06:38 AM.

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