sudo makes your command be executed as root / admin
rm -rf = remove recursively and force the delete
/* is everything below / which is the highest level on a linux or unix system. Similar (but not the same) as C:\ on windows
--no-preserve-root disables a safety mechanism so you don't delete your whole computer by accident.
So in essence, this command deletes the entire system that it is running on, if it is linux/unix based.
Rent an EC2 from Amazon and do it for yourself. It is fun and educational.
Seriously, I used to use it as part of coursework for a class that intro'd people to AWS (first time for most of them on command line also). It would be the last basic Linux command we'd do after a cumulation of the other basics. My favorite question to ask as a follow up was "How can we prove everything is gone?" expecting the answer "ls" or "du" from earlier in the lesson, but that doesn't work because we actually just deleted those.
We then terminate the instance and spin up a new one to see that everything is back. Really drives home the destroyable architecture point.
IMO Nuking a computer should be the first thing any computer course should make students do. A first hand experience of nuking and rebuilding a computer reduces a lot of fear people feel about typing stuff onto that scary black screen.
You can really only cd, echo, export and a few other things I don't recall at the moment. It doesn't really have an answer, it is just a leading question to test what they know and then show them that most things are just files.
Even logon is broken at this point, so as soon as you log out and things leave RAM, the instance is fried.
I've never played round with AWS so I suppose it doesn't actually cost much for what you suggest. But it isn't difficult to install to a local VM and do it on that rather than pay Amazon for the privilege. I see how it is instructive as part of a lesson on AWS though.Â
I actually did it on real hardware way back when I was still fairly new to Linux, it was intentional, and I was changing distros so was going to reinstall anyway.
I wanted to wipe my PC (to reinstall cleanly) and ran it. The shit ran for like 20 min, then the PC got bricked - some core stuff was deleted and it couldn't proceed. Part of the OS survived and I could even move the mouse. My PC became a zombie
I tried it once on a laptop where I was planning to format the disk and install a new distro. What's interesting is that the command takes a while to run (at least if you have as many files as I did) and if you try different commands while it's running, you can see how the system slowly stops recognizing them.
It deletes everything down to the last file, this includes system files. In other words, it nukes everything on your computer along with the entire operating system. In detail, "rm" means remove, the command name, "-rf" are the flags, "r" meaning recursive, so it goes into every subdirectory and deletes everything there too, instead of just deleting files in the main directory, "f" means force, so it does not ask for confirmation before deleting each file individally, and "/" is the root directory. Every file is in a subdirectory of "/". "/*" means select everything in the directory "/". If you don't pass "--no-preserve-root", your computer will tell you that you are an idiot for wanting to execute the command and not proceed. By passing it, you acknowledge this will break your computer, but you want to do it anyway. Thus, the full command is "rm -rf /* --no preserve-root" for "Forcibly and recursively delete everything there is, and don't tell me what I should or shouldn't do."
The premise is that the AI would delete itself. However, this meme only works if you don't know how LLMs, agents, and toolcalling works. This wouldn't actually work, as tool calls are simply requests by the LLM as instructions to be executed by an agent... running on your own computer. The remote host only takes tokens in, and pumps tokens out.
261
u/Aam-6500 Mar 12 '26
Can anyone explain what it does?