![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 | ||
|
|
|
|||
|
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 |