Used rm -rf accidentally to delete - how to recover

Discussion in 'Mac Basics and Help' started by rehaana, Mar 6, 2008.

  1. rehaana macrumors newbie

    Joined:
    Mar 6, 2008
    #1
    Hi,
    I accidentally used "rm -rf" command to delete from the top directory instead of the one that i actually wanted to delete. Started with gcc giving error messages that it cant open a.out.

    So , a lot of applications ( including ones that came with MAC leopard - chess, garage band etc ) got removed . Cant find them in Trash.
    .Trashes doesnot have permission - shows administrator as the owner even though I am the administrator.

    Cant find the logfiles to check what happened. Could someone please tell me Where are they located?

    I donot have backup. Please tell me how to recover those applications - actually i dont even know what all got deleted since dont know where the logfile is.
    :(

    Plesae help.

    Thanks a lot.
     
  2. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    Reinstall Leopard. Then buy an external hard drive and use Time Machine. It might be a good idea for you to delete Terminal.
     
  3. jeremy.king macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #3
    LMAO :eek:

    OP - you are screwed. Well, I guess you could spend hundreds/thousands with a data recovery firm to recover those deleted files. You won't find them in the Trash, so don't bother wasting your time looking.
     
  4. killmoms macrumors 68040

    killmoms

    Joined:
    Jun 23, 2003
    Location:
    Washington, DC
    #4
    rm -rf = GONE.

    Good ol' BSD. It does exactly what you tell it to... which is why you never do stuff unless you're sure you're doing it right.
     
  5. ethernet76 macrumors 6502a

    Joined:
    Jul 15, 2003
    #5
    There are ways to get your files back. You just have to ask how important they are.

    I've used a program called testdisk on the windows side. It also has a Mac version.

    If you really need to recover your files send me a PM and I can explain what my department's procedure is when a professor gets delete happy.

    If it's just applications I'd back up your personal data and reinstall leopard/tiger/panther/etc. It'll take a lot less time.
     
  6. brn2ski00 macrumors 68020

    brn2ski00

    Joined:
    Aug 16, 2007
    #6
    OMG, that is a big NO-NO.... just about as bad as "rm -r *"

    WOW
     
  7. ebel3003 macrumors 6502a

    ebel3003

    Joined:
    Jun 20, 2007
    Location:
    "The Google"
    #7
    I've joked around about this with other Unix junkies before, but I've never heard or seen this actually happen.

    You're better off just reinstalling leopard and maybe running as a lower level user.

    rm -rf / will leave you with a nice clean root.
     
  8. brn2ski00 macrumors 68020

    brn2ski00

    Joined:
    Aug 16, 2007
    #8
    Better question is why would you run that command anyway? Just use the UI if you want to manage files. The Terminal is only for Trekkie nerds...
     
  9. ebel3003 macrumors 6502a

    ebel3003

    Joined:
    Jun 20, 2007
    Location:
    "The Google"
    #9
    Sometimes it's easier/faster if you know where the file is already. I personally find typing faster than clicking. I guess that makes me a "Trekkie nerd". :D
     
  10. brn2ski00 macrumors 68020

    brn2ski00

    Joined:
    Aug 16, 2007
    #10
    I hear ya, but yeah... it does! :)
     
  11. richard.mac macrumors 603

    richard.mac

    Joined:
    Feb 2, 2007
    Location:
    51.50024, -0.12662
    #11
    OH NOS! always use "ls" to see whats in the directory your dealing with. well thats what i do.

    is the Users folder gone? can you still login? i would erase and install Leopard.
     
  12. mckyvlle macrumors 6502a

    Joined:
    Nov 21, 2007
    Location:
    London, UK
    #12
    Tough luck! Running that command on a *nix systems practically guarantees hosing your files. USB sticks are dirt cheap these days, get one and put your important stuff on it.
     
  13. Tom Yt macrumors newbie

    Joined:
    Mar 6, 2008
    #13
    Wow. I was an exclusive linux user for almost a half decade and always read jokes about this happening to people. Never thought I'd see one in real life, certainly not on a mac.

    Kidding aside, truly am sorry for your loss. In my early days of using linux, without any prior knowledge, I did some rather idiotic things. Trust me, one day you'll look back at this and laugh. It'll be a vary painful laugh, but a laugh none the less.

    and yes. given the prices of external drives and the availability of time machine, there is no reason as to why someone should not use it.
     
  14. aross99 macrumors 68000

    aross99

    Joined:
    Dec 17, 2006
    Location:
    East Lansing, MI
    #14
    Like the others have said, just reload leopard. There is really no way to restore the files you deleted - especially if you don't know which ones they were.

    Once you delete important parts of OS X, you are pretty much stuck...
     
  15. thewhitehart macrumors 6502a

    thewhitehart

    Joined:
    Jul 9, 2005
    Location:
    The town without George Bailey
    #15
    Did the applications themselves get removed? Or are they just not working?

    Sounds like you were working on files near the root, and deleted the Applications folder itself. I'd definitely reinstall Leopard, but you could also find another mac user and just copy over their applications folder, minus any licensed apps they paid for but including all of the standard Apple ones.
     
  16. Leareth macrumors 68000

    Leareth

    Joined:
    Nov 11, 2004
    Location:
    Vancouver
    #16
    Actually dealt with similar thing last week
    the only thing that wa able to recover data was File Salvage, loaded on my computer , firewire target mode to the other persons machine with full salvage to external drive.
    yeah got everything back.
    including stuff from a few months back long deleted, but not a disaster.
     
  17. rehaana thread starter macrumors newbie

    Joined:
    Mar 6, 2008
    #17
    Thanks all of you.

    What actually happened ws that I had installed gcc 4.0 then installed a later version of gcc, after which things stopped working. So, I was removing the gcc completely and going to reinstall it. And then I did, cd.. , cd.. andrm -rf * , thinking that I was still in the top level gcc dir while I actually was near to the root directory.

    Anyway, I have decided to alias my rm command to "rm -i " in .bashrc file so that it always asks me ( unless some day i decide to use \rm - which i am pretty sure that i wd since i have very little patience) .

    I guess I am going to re-install leopard ( i prefer that since it ensures a clean slate when i dont know which files got deleted ) . But what i am wondering is where do teh files actually go if i delete them using "rm -rf". Since they can still be got back using some tools, doesnt that mean that they shd be around in the hard-disk. may be not in a file format though. Anyway, thanks for all teh support. You guys are awesome.
     
  18. jsherk macrumors newbie

    Joined:
    Jan 9, 2012
    #18
    @ethernet76 - Do you still have your departments procedure available for a delete happy person like me?
     

Share This Page