How-To Geek
Use Grep to Recover Deleted Text Files On Your Linux Box
Over at the Atomic Spin weblog, they’ve written up an interesting tip that uses grep to recover files. Here’s the brief command you’d use, but hit the link for the full explanation.
Since the file I was hoping to recover was a text file, and I knew a fair amount about it (such as approximate file size and some text that was definitely going to be included), finding it actually turned out to be fairly simple task using grep:
grep -a -B 25 -A 100 'some string in the file' /dev/sda1 > results.txt
Got Feedback? Join the discussion at discuss.howtogeek.com
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 08/19/10



