The UNIX and Linux Forums  

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
grep a string from 2 text files karthikn7974 Shell Programming and Scripting 15 04-24-2008 12:15 AM
How do I rename a bunch of files at once? bbbngowc UNIX for Dummies Questions & Answers 8 04-21-2008 06:23 AM
Renaming a bunch of files Prashanth.m Shell Programming and Scripting 2 09-20-2005 10:16 PM
text files, ASCII files, binary files and ftp transfers Perderabo Answers to Frequently Asked Questions 0 04-08-2004 01:25 PM
grep multiple text files in folder into 1 text file? coppertone UNIX for Dummies Questions & Answers 7 08-23-2002 11:50 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-19-2000
Registered User
 

Join Date: Sep 2000
Posts: 3
Unhappy

I have, say, a dozen files, and I want to grep for a string of text within them. I don't remember the exact syntax, but let me give it a shot and show you an idea here...
find . -type f -exec grep thisword {} \;
...and there's a way to put more than one grep into the statement, so it will tell you the file name too... anyone want to help me tackle this one? I used to have it written down, but of course I lost the piece of paper... :..(
- Suz
__________________
Susan K.
Unix Sun/HP System Administrator
Forum Sponsor
  #2 (permalink)  
Old 09-19-2000
Registered User
 

Join Date: Sep 2000
Posts: 3
Got it figured out...

Duh, that took me all of about 2 minutes to figure out...
find . -type f -exec grep -l word {} \; -exec grep word {} \; -exec echo \;
...and all the echo at the end does is put a space between the results to make them clear... *sigh*
__________________
Susan K.
Unix Sun/HP System Administrator
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0