Register
It is currently Fri Oct 31, 2014 5:24 am

fetch some characters in the files of a tree and show it


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Wed Oct 10, 2007 12:30 pm   

Joined: Wed Oct 10, 2007 12:05 pm
Posts: 1
I'm pretty sure it already exists a similar script.

I'd like to fetch the result of
Code:
cat */*

for a specific word or character sequence

It should also be able to move though the sub-directories and show the files where it finds something.

Now I'm using a raw script, it doesn't show anything if it's in a sub-directory and .. I CAN'T KNOW THE FILENAME!!

Code:
cat */* | grep 'where_are_you_line'

(sometimes with "grep -a" :o )


Top
 Profile  
 PostPosted: Wed Oct 10, 2007 2:48 pm   
Moderator
User avatar

Joined: Wed May 03, 2006 2:05 pm
Posts: 242
Hi gionnico!

Does this:

# grep -r 'where_are_you_line'

do what you need? It greps recursively into directories, and shows the name of the directory/file that each match was found in. I have an idea for a script if you need something more customized than that... Let me know if this helps!

-jeo


Top
 Profile YIM  
 PostPosted: Thu Oct 11, 2007 8:30 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
i edited the above two posts... for uhh... spelling :wink:


Top
 Profile  
 PostPosted: Thu Oct 11, 2007 8:51 am   
Moderator
User avatar

Joined: Wed May 03, 2006 2:05 pm
Posts: 242
Took me a second, but I found it :lol:


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 10 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:  


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