29

2 weeks ago I was writing an `rm -rf --no-preserve-root /` oneliner as a joke - as an answer to a question "I have access to my competitor's server; what should I do?". I was crafting it so that it'd do as much damage to the business (not the server) as it could.

And I accidentally executed it on my work laptop. In the background (with an `&`).

It ran for a good 5-7 seconds on an i7-11850H with an SSD, until I issued a `kill %%`

Good thing it ran as a non-root user. Bad thing - I have no idea what it may have deleted nor whether it touched my /home.

I'm afraid to restart my laptop now :)

whoopsie :)

Comments
  • 22
    Appropriate time to say: "the joke’s on you " 😱
  • 2
    Oh you done goofed up 😅 How did you even manage to accidentally run it?
  • 3
    @ScriptCoded I was writing it in a shell with `#` at the beginning. Then I temporarily removed the comment to copy it along with the hacker-ish prompt (PS1). Pasted the contents as the answer and switched back to the terminal. And then, out of inertia, hit ENTER a few times to create a visual separation for the next commands to run.

    Turns out I forgot that I had that `#` removed...
  • 2
    @netikras oh no, that's true unluckyness! And perhaps a bit of carelessness 🙈
  • 0
    @netikras can you run Unix style commands in PowerShell?
  • 2
    @ScriptCoded PS1 has nothing to do with Powershell. It is the prompt in front of every line
  • 2
    If you are gonna write asshole scripts do them in a vm man. Something you can recover. Nice story, sorry it messed up your stuff.
  • 5
    @Demolishun

    > in a vm

    or a container :D

    that's the thing - I don't know if it messed up anything :) Now it's a Schrodinger's laptop: both messed up and not at the same time, and its actual state is unknown until a reboot :D
  • 1
    @jonas-w oh I didn't know!
Add Comment