So I set my password to

sudo rm -rf --no-preserve-root /
  • thesdev@feddit.org
    link
    fedilink
    arrow-up
    33
    ·
    3 days ago

    So the other day, I saved a big object to a file during a debugger session with a path like ~/debug.json only to find out later that the debugger didn’t support shell expansions and instead of saving to the home directory it had literally saved the file under a directory called ~ inside my project. Now at that point I didn’t need the file anymore anyway, so you never guess what I proceed to do next, and mind you now I was in my regular terminal: I ran rm -rf ~. Lost a bunch of dot files, but thankfully all the permission errors I got made me realize what was going on and I cancelled the operation quickly before any bigger damages were done.

    • Supercrunchy@programming.dev
      link
      fedilink
      arrow-up
      8
      ·
      3 days ago

      Oh yes, the classic rm -fr ~ I wouldn’t be surprised if current AI models would try to do the same command for deleting a folder named ~

      Another fun one is rm -fr .* if you want to delete dotfiles (hint: .. ).

      Sometimes it’s just better to open the file manager, select files and hit delete manually.