There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Linux and Unix
Tag Cloud
access acer asus bios bsod computer crash dns driver drivers error ethernet excel freeze gaming google hard drive hardware hdmi internet laptop mac malware memory monitor motherboard mouse network printer problem ram registry router server slow software sound svchost.exe trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Searching through many text files

Reply  
Thread Tools
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
25-Feb-2009, 02:53 PM #1
Searching through many text files
Ok, here's what happened. I accidentally deleted an encrypted folder. To solve this problem I used a few utilities to recover lost data from ext3 partitions. I sent all the recovered info to /media/external. I ended up with 67 folders worth of recovered media.
/media/external/recover.[1-67]

Each file within those subdirectories is in the form of fxxxxxxx.[txt | gz |html] with x being a number. I was wondering if I could use grep to search through all the files in all of these directories to locate an email address.
tomdkat's Avatar
Computer Specs
Distinguished Member with 7,127 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
25-Feb-2009, 03:10 PM #2
Yep. Use the "-r" option to recurse directories.

Run "man grep" to get the scoop on the many different things grep can do.

An example would be:

$ grep -r "tomdkat@techguy.org" /media/external/recover* | more

or

$ grep -r "tomdkat@techguy.org" /media/external/recover* > files.txt

There are also options to control the grep output, so you only get filenames or the filenames are omitted, etc.

Peace...
absolutezero1287's Avatar
Senior Member with 210 posts.
 
Join Date: May 2007
Experience: Intermediate
25-Feb-2009, 07:07 PM #3
Thanks very much. Although I couldn't recover the encrypted file I was able to search through everything with relative ease.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:25 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.