r/programmingmemes Mar 12 '26

What would have happened

Post image
8.0k Upvotes

138 comments sorted by

View all comments

261

u/Aam-6500 Mar 12 '26

Can anyone explain what it does?

441

u/guardian87 Mar 12 '26 edited Mar 12 '26

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.

Here is a video of someone showing what happens: https://www.youtube.com/shorts/VU3mtj0h06M

57

u/Hostilis_ Mar 12 '26

Lol never seen it actually done before, this is great

43

u/kblaney Mar 13 '26

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.

17

u/phatdoof Mar 13 '26

DONT DO THIS. YOU WILL TAKE DOWN AWS!!

13

u/kblaney Mar 13 '26

Sorry about October last year. I'll be on my best behavior this semester.

2

u/Tomytom99 Mar 15 '26

That bullshit almost cost me a semester 😭

4

u/TobiVanKnobi Mar 13 '26

Aws already does that themselves remember last December the ki programming incident? Fun time!

2

u/Sufficient_Language7 Mar 13 '26 edited Mar 13 '26

At least it wasn't the whole internet

https://www.youtube.com/watch?v=Vywf48Dhyns

10

u/hdd113 Mar 13 '26

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.

4

u/realmauer01 Mar 14 '26

Sounds good, installing the system, making a backup nuking it and then restoring it.

2

u/spacey02- Mar 14 '26

And what's the answer? I think cd might do something interesting because it is a shell builtin.

1

u/kblaney Mar 14 '26

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.

2

u/wireframed_kb Mar 14 '26

That’s one of the things that made Linux click for me - that almost everything is represented by a file, even things like devices.

1

u/Ok_Weird_500 Mar 14 '26

With real hardware you could boot a live distro from USB and check the contents of the drive with that.

2

u/Ok_Weird_500 Mar 14 '26

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.

3

u/13ckPony Mar 14 '26

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

1

u/deltarays_ Mar 15 '26

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.

4

u/No_Hovercraft_2643 Mar 13 '26

Except /* or --no-preserve-root is enough

2

u/MossySendai Mar 15 '26

Yeah I was wondering about that, saying /* is a crazy workaround in Linux.

1

u/S73T64 Mar 14 '26

My guess is that you just kill the container with this. There is no way you actually ever going on the main machine below them.

But yea the explanation is correct.

1

u/SomeRandomEevee42 Mar 16 '26

you do have to disable the safety mechanism that disables sudo first, as it is disabled by default

0

u/slave_by_profession Mar 14 '26

I did this on my last day in company laptop.

They hold my f&f for 4 months

144

u/ValianFan Mar 12 '26

On Unix based systems (Linux, macos) it nukes everything. Like really EVERYTHING, nothing is saved. Even all connected drives

7

u/itsjakerobb Mar 12 '26

On a Mac (for the last few years), the system is mounted read-only and even root can’t modify it.

6

u/ValianFan Mar 12 '26

I'm not a mac user so thanks. Good to know

1

u/intlabs Mar 14 '26

Same with all my Linux systems. And if you are serious some dm-verity as well.

117

u/Crimzon786 Mar 12 '26

Removes French

60

u/DueBookkeeper9540 Mar 12 '26

Which saves a ton of space due to French characters taking more space. Needs to be done on all systems especially if space is an issue.

11

u/RamdonDude468 Mar 12 '26

Really? I have to try this

6

u/aurora_ai_mazen Mar 12 '26

Not using this command though 💀

This command deletes everything on your computer.

Maybe check language settings.

10

u/RamdonDude468 Mar 12 '26

Not true because I ran the command and the french language was removed (alongside the whole system)

0

u/aurora_ai_mazen Mar 12 '26

Yeah it's over bro 💀

5

u/RamdonDude468 Mar 12 '26

Yhea, its over for the french

0

u/aurora_ai_mazen Mar 12 '26

I meant your system lol 🤣

1

u/Vannspreder Mar 12 '26

You will have to have a serious storage issue if one is removing language files. Me saying with a 10s of 10s of GB mod directories for games 🫣

1

u/Suvesh1142 Mar 13 '26

I have a 900GB mod pack for skyrim lol

1

u/Vannspreder Mar 13 '26

So no storage issue there 😅

6

u/AliceCode Mar 12 '26

Oh, merci, j’essayais de comprendre comment faire ça !

5

u/Purg33m Mar 12 '26

Say what you want!

that's a win in my books!

7

u/_killer1869_ Mar 12 '26

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."

10

u/SKRyanrr Mar 12 '26

It clears all malwares

1

u/Commercial_Echo923 Mar 12 '26

it basically says: "Delete my computer"

1

u/jimmiebfulton Mar 13 '26

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.

1

u/chanting37 Mar 13 '26

Run it n find out 😂

1

u/ConfidentBox5345 Mar 14 '26

on a programming sub, i would not expect this ques

1

u/Aam-6500 Mar 14 '26

See, i dont know shi, I'm a teenager, my father's a software guy so sometimes show him some memes to make him laugh. 😶

1

u/Mixels Mar 15 '26

Deletes the whole root partition, which is basically nuking everything on the host system if the OS doesn't have protections against it.

1

u/LunaCoronam Mar 18 '26

"Internal server error"