LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to recover deleted file (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-recover-deleted-file-447607/)

v1nc3nt 05-23-2006 03:56 AM

How to recover deleted file
 
i delete a file using rm -rf command

how do i recover this

dubz_444 05-23-2006 04:04 AM

with great difficulty.

i remember though there was an article about it in the linux gazette
google it.

jesuscakes 05-23-2006 04:08 AM

Quote:

Originally Posted by dubz_444
with great difficulty.

i remember though there was an article about it in the linux gazette
google it.

Ouch. Is this the article in question?: http://linuxgazette.net/issue86/artime.html

Simon Bridge 05-23-2006 04:09 AM

There are a range of threads in these forums about recovering lost files.
In general - if this is on an ext2 fs there are "recover" utilities for your pleasure. If this is on a journalling fs like ext3 - you will have a tougher time of it. The file is all-but [tone=portentious]gorn[/tone].

The unix method is to grep through the partition for it.
http://www.linuxquestions.org/questi...t=recover+grep
http://www.linuxquestions.org/questi...d.php?t=428962
http://www.linuxquestions.org/questi...grep+partition

dubz_444 05-23-2006 04:16 AM

the linux gazette article was the unix method of grep-ing . its works sort of...

was a good few years ago though

Simon Bridge 05-23-2006 04:28 AM

Quote:

Originally Posted by dubz 444
the unix method of grep-ing . its works sort of...

sort-of is right. It is brilliant for anything text related or if you know your target. But a long arduous task for general file recovery... especially compressed, encrypted, or binary files. You really have to know your stuff, and it's hard to automate.

There are also a range of "forensic" distros around (another google search term) which can do better.

rm -rf is, of course, one of those commands you do not use. Data recovery is what the trash bin is for.

Some people make a trash directory for CLI use, and a script in their path called "can" or something. All "can <filename>" does is move the offending file to the trash directory. (Though you can also rig something to clear the trash directory when you logout or some other condition is met).


All times are GMT -5. The time now is 05:57 AM.