[opensuse] Undoing a delete
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask... -- ---Bryen--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Sat, 17 Nov 2007, by suseROCKS@bryen.com:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
A backup comes to mind.. What filesystem, did you google? http://e2undel.sourceforge.net/recovery-howto.html Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131 SUSE 10.2 + Jabber: muadib@jabber.xs4all.nl Kernel 2.6.20 + See headers for PGP/GPG info. Claimer: any email I receive will become my property. Disclaimers do not apply. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 2007-11-17 at 23:59 +0100, Theo v. Werkhoven wrote:
Sat, 17 Nov 2007, by suseROCKS@bryen.com:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
A backup comes to mind.. What filesystem, did you google? http://e2undel.sourceforge.net/recovery-howto.html
A backup doesn't apply in this case. :-( It was a script I was working on this afternoon. Brand new, hasn't gone into the backup cycle yet. And my fs is ext3. -- ---Bryen--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 17 November 2007 14:40, Bryen wrote:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
The short answer is "no." There's no "trashcan" or "wastebin" involved. Only with tremendous luck and heroic effort could you hope to recover the contents of the file to which you applied the stock "rm" command. I've known users (dare I say, "lusers") to override rm with a script that moves the target files to a trashcan folder. I don't suppose it will be long now before we have a Linux counterpart to the latest Mac OS's "Time Machine" functionality.
-- ---Bryen---
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat November 17 2007 15:40, Bryen wrote:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
Googling for "undelete ext3" showed this recent link, which might lead you somewhere: http://kerneltrap.org/node/14493 -- Carlos FL Who is General Failure, and why is he reading my disk? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 2007-11-17 at 17:18 -0700, Carlos F Lange wrote:
On Sat November 17 2007 15:40, Bryen wrote:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
Googling for "undelete ext3" showed this recent link, which might lead you somewhere: http://kerneltrap.org/node/14493
-- Carlos FL
Cool... I'm going to give this giis tool a try. Unfortunately, the disclaimer is that you can't undelete files deleted before giis was installed. Aggghh!!! I'm just going to live with the fact that the only thing deleted was just my afternoon's work, and not anything mission-critical. Thanks everyone!
---Bryen---
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bryen wrote:
On Sat, 2007-11-17 at 17:18 -0700, Carlos F Lange wrote:
On Sat November 17 2007 15:40, Bryen wrote:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask... Googling for "undelete ext3" showed this recent link, which might lead you somewhere: http://kerneltrap.org/node/14493
-- Carlos FL
Cool... I'm going to give this giis tool a try. Unfortunately, the disclaimer is that you can't undelete files deleted before giis was installed. Aggghh!!!
I'm just going to live with the fact that the only thing deleted was just my afternoon's work, and not anything mission-critical.
Advice...when writing scripts which REMOVE files, always set up a test directory structure first. example: cp -R realdata test This will recreate the entire realdata directory tree (including files) in another directory called test. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bryen wrote:
Is there any way to undo an rm in terminal?
No. Unless you want to spend a lot of money.
Probably not, but thought I'd ask...
Of course, in the 24 years since I started using Unix, there have been exactly 2 times when I rm'ed files which I didn't want to. The first time was in 1986 or 1987 when I accidentally rm'ed a C source code file. Fortunately, i had a hard copy print out after a recent edit. The second time was in a find command I was in /, but I had just done ls /tmp, and for some reason, I was thinking I was in /tmp,... a guy's /tmp was filled on his workstation, and he was all over me to hurry up.... I did a find . -name -exec rm \{\}\; I *SHOULD have done find /tmp -name rm \{\} \; about halfway through /bin, I realized something was seriously wrong, and hit Ctrl-C TOO LATE! I had to reinstall the OS (HP-UX) That was 1995. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Aaron Kulkis a écrit :
Bryen wrote:
Is there any way to undo an rm in terminal?
Have a look here : http://www.diskdoctors.net/linux-data-recovery/software.html Good luck. Michel -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun November 18 2007 01:01, Catimimi wrote:
Aaron Kulkis a écrit :
Bryen wrote:
Is there any way to undo an rm in terminal?
Have a look here :
http://www.diskdoctors.net/linux-data-recovery/software.html
Is the world backwards? This is a Win32 product! Do they want me to go and find a Windows machine to run this recovery tool for a Linux formated disk? What are they thinking? -- Carlos FL Who is General Failure, and why is he reading my disk? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Aaron Kulkis wrote:
Bryen wrote: I did a find . -name -exec rm \{\}\;
Just curious; what use cases are there for calling find with -name without a pattern for -name?
I *SHOULD have done
find /tmp -name rm \{\} \;
This one too; looks to me like the pattern being passed to -name is rm itself... JA - -- http://www.DonAssad.com jabber ID: josef.assad@gmail.com Please consider the environment; do you really need to print out this e-mail? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFHQBzbFcf72sjD2+QRAuLkAJ0b4js8KLKw4ZWdifEgXj/1yU8CawCgoBZ6 2W+6b4O3LAuhUjBrg/n444g= =Ji0w -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Josef Assad wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Aaron Kulkis wrote:
Bryen wrote: I did a find . -name -exec rm \{\}\;
Just curious; what use cases are there for calling find with -name without a pattern for -name?
ooops. that should have been find . -print -exec rm \{\}\;
I *SHOULD have done
find /tmp -name rm \{\} \;
This one too; looks to me like the pattern being passed to -name is rm itself...
find /tmp -print rm \{\} \; -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bryen escribió:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
In short: no. http://www.faqs.org/docs/artu/ch20s03.html#id3015838 In large: yes, but you need a good chunk of knowledge, luck, and sometimes some really very expensive hardware. They only easy and cheap way is called backups. -- "The only thing that interferes with my learning is my education." - Albert Einstein -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 2007-11-17 at 16:40 -0600, Bryen wrote:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
-- ---Bryen---
Depending on what you want to recover the following worked for me - to recover images I deleted from a USB flashdisk (will do other file formats as well) http://www.cgsecurity.org/wiki/PhotoRec E-mail Disclaimer http://www.sunspace.co.za/emaildisclaimer.htm -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 2007-11-17 at 16:40 -0600, Bryen wrote:
Is there any way to undo an rm in terminal? Probably not, but thought I'd ask...
-- ---Bryen---
#!/bin/sh # #MoveWithPWD #You must translate the slash or the move will fail. # MyPWD=`echo $PWD | tr '/' '-'` #echo $MyPWD # #In the for loop you specify the files you wish this gets them all #See man ls # for i in `ls -A`; do mv -v $i /home/<user>/.Trash/$MyPWD.$i; done to list the files if you choose minus for the translation of the / The double dash must be after the minus l in order for the command to know to handle files starting with a minus. ls -l -- -* -rw------- 1 cwsiv users 15416571 2007-11-29 16:26 -home-cwsiv-test.dummy.071111 -rw------- 1 cwsiv users 7771751 2007-11-29 16:26 -home-cwsiv-test.dummy.071112 -rw------- 1 cwsiv users 9933056 2007-11-29 16:26 -home-cwsiv-test.dummy.071113 -rw------- 1 cwsiv users 8629139 2007-11-29 16:26 -home-cwsiv-test.dummy.071114 -rw------- 1 cwsiv users 11471762 2007-11-29 16:26 -home-cwsiv-test.dummy.071115 -rw------- 1 cwsiv users 9405675 2007-11-29 16:26 -home-cwsiv-test.dummy.071116 All my scripts started as other peoples ideas modified many times for my own needs. This is the best I could do on short notice. Of course you will have to put this under some directory on your user and make a alias for rm in either dot profile or dot bashrc referring to this script. So now you have your first script enjoy it in good health and have some fun with it, on test data. Likely someone here will provide you a reversal script for restoring single files from .Trash to their original locations. ___ _ _ _ ____ _ _ _ | | | | [__ | | | |___ |_|_| ___] | \/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (10)
-
Aaron Kulkis
-
Bryen
-
Carl Spitzer
-
Carlos F Lange
-
Catimimi
-
Cristian Rodríguez
-
Hans van der Merwe
-
Josef Assad
-
Randall R Schulz
-
Theo v. Werkhoven