Register
It is currently Thu Jul 24, 2014 6:18 am

Grep recursively across folders


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Thu Jun 08, 2006 5:48 pm   

Joined: Mon Apr 24, 2006 2:39 pm
Posts: 30
Location: Villahermosa
So I want to do a less on my email (mbox) I have my email distributed across several folders such as
Code:
accont#/
    200#/  <-- being year
       04/   <-- Number of month
        29/   <-- Number of day
         mail.mbs



So what I want is a recursive use of less so I can read all the email with out having to hop on each directory, is there anyway i can do this somehting like:
Code:
less -R * | grep <keyword>


Regards.


Top
 Profile WWW ICQ YIM  
 PostPosted: Fri Jun 30, 2006 2:44 pm   
Moderator
User avatar

Joined: Wed May 03, 2006 2:05 pm
Posts: 242
Heya jza!

I'm not sure I know exactly what you're looking for, but try this:

Code:
find . -type f -exec grep keyword {} \;


You can also do some fun stuff with regular expressions :) If you want help with that, paste an example of a line that you're looking for.

Hope this helps!
-Jeo


Top
 Profile YIM  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP