The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Retreive content between specific lines ina file chennaitomcruis Shell Programming and Scripting 4 04-19-2008 10:18 AM
grep/cat/more -- search in a txt file and display content from a specific "keyword" I-1 UNIX for Dummies Questions & Answers 4 02-21-2007 04:57 AM
Search files that all contain 4 specific words WoodenSword Shell Programming and Scripting 13 01-22-2007 06:57 AM
search for certain word in a files from directory legato UNIX for Dummies Questions & Answers 1 10-31-2006 06:35 AM
Search all files for specific string sureshy UNIX for Dummies Questions & Answers 4 03-06-2002 12:28 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 01-03-2007
amjath78 amjath78 is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 2
Talking How to search files containing a specific word in the content

Hi all,

Lets say I have 3 files a.txt and b.txt and c.txt.

a.txt has the following text
====================
apple is good for health

b.txt has the following text
====================
apple is pomme in french

c.txt has the following text
====================
orange has citric acid


Now apple is a word common in both a.txt and b.txt... How do I find all the files which are containing the word apple, so that the output will be a.txt and b.txt.

Please help..

  #2 (permalink)  
Old 01-03-2007
iamcollins iamcollins is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 8
Excuse if i am wrong

This command searched recursively and prints the file names matching the search string in its content ignoring the case.

grep -r -l -i "apple" *

Last edited by iamcollins; 01-03-2007 at 03:50 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0