• dadarobot@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    i think the better way would be to replace rm with something that just moves files to a trash bin like how graphical file managers do it.

    if you were just pulling the data back off the disk, and you didnt notice it IMMEDIATELY or a background process is writing some data, it could still be corrupted.

    there was something like that i had on win3.2 called like undel.exe or something, but same deal, often it was courupted somehow by the time i was recovering the data

    • thebestaquaman@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      I usually don’t think about it at all, but every now and then I’m struck by how terrifyingly destructive rm -r can be.

      I’ll use it to delete some build files or whatever, then I’ll suddenly have a streak of paranoia and need to triple check that I’m actually deleting the right thing. It would be nice to have a “safe” option that made recovery trivial, then I could just toggle “safe” to be on by default.

        • thebestaquaman@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          1 month ago

          Honestly, after re-reading my own comment, I’m considering just putting some stupid-simple wrapper around mv that moves files to a dedicated trash bin. I’ll just delete the trash bin every now and then…

          -Proceeds to collect 300 GB of build files and scrapped virtual environments over the coming month-