Review your favorite Linux distribution.
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 04-04-2004, 11:01 AM   #1
Registered: Sep 2003
Posts: 228

Rep: Reputation: 30
grep a phrase

I have been reading about grep, egrep and fgrep, and I can't seem to figure out how to get grep to search for a whole phrase ie(media tray) instead of just media and tray seperately. Anyone help?
Old 04-04-2004, 11:10 AM   #2
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Try grep "media tray" filename. You can use the -Hn switches to grep to make it display filename and line number if you're grepping through several files.



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 03:36 PM
Which command to search text/phrase in file? b:z Linux - General 2 03-30-2005 09:11 PM
Search all man pages for a phrase suguru Linux - Software 1 09-12-2004 06:38 AM
pass phrase from disk in ppdd shashi_lq Linux - Security 1 04-18-2004 05:52 AM
grep [exact phrase] chrisfirestar Linux - General 2 02-09-2004 04:30 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:36 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
Open Source Consulting | Domain Registration