I accidentally untarred archive intended to be extracted in root directory, which among others included some files for /etc directory.
I went on to rm -rv ~/etc, but I quickly typed rm -rv /etc instead, and hit enter, while using a root account.

  • heavyboots@lemmy.ml
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    2 hours ago

    Welcome to the “I have shot myself in the foot with rm” club! Take a seat anywhere!

    (Mine was trying to delete the old System 9 “System Folder” by typing rm -rf System\ Folder, but instead hitting the return key when it came time to hit the \, thereby starting a deletion of the running macOS 10 operating system inside the “System” folder. It got through the c’s in the second and a half or so before my frantic control-C attempts halted it. Amazingly, OS X would still boot, but no longer run Carbon apps, necessitating a complete OS reinstall, lol.)

    • phx@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 hour ago

      I try to always put the -rf at the end for this reason. Not sure what works on Mac but it does allow it on most Linux shells