Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Reading Multiple Text FIles Help! (SOLVED)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
eusanpe
Tux's lil' helper
Tux's lil' helper


Joined: 06 Sep 2002
Posts: 107

PostPosted: Wed Mar 05, 2008 2:04 am    Post subject: Reading Multiple Text FIles Help! (SOLVED) Reply with quote

Everyone is entitled to a case of the dumbazz and now was my turn. Here is my dilemma..

On my email server I had a cron job that changed to a directory and deleted certain files
greater than seven days old. Well I decided to do some modifications to my email server
and I removed the directory and changed the way that my email functions. Well for some
reason I forgot about the cron job and when it ran, it couldn't find the directory so it decided
to perform the next step and delete all of my files in my home folder. I had things backed up
to my backup email server but unfortunately it happened there also.

I rebuilt my reiserfs partition and was able to recover about 117,000+ files with the naming
convention of 10000_10000, etc.. What I need to do is go through each file and if it contains
a certain word or words, like my email address, move that file to another folder. Once it is
done then it will loop and read the next file. I have a listing of all of the files in a text file.
Once it is finished, I can delete the remaining files.

Can anyone show me how to do this?

Thanks,
Tony


Last edited by eusanpe on Wed Mar 05, 2008 2:53 am; edited 1 time in total
Back to top
View user's profile Send private message
eusanpe
Tux's lil' helper
Tux's lil' helper


Joined: 06 Sep 2002
Posts: 107

PostPosted: Wed Mar 05, 2008 2:53 am    Post subject: Reply with quote

I just did the following and it worked out for me...

grep -Hl <email address> * >> email.txt


Tony
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum