r/linuxquestions • • Mar 22 '22

Absolute most dangerous command in linux?

I am familiar with the

sudo rm -rf /* 

and yes, this is very dangerous. Like I get it. Beyond comprehension. However, I have ran this command and while everything does get removed and the VM won't boot the next time around, my current shell is still intact. For example, I run:

user@vm:/$ echo we still alive out here?
we still alive out here?

Sure `ls might be gone:

user@vm:/$ ls
-bash: /usr/bin/ls: No such file or directory

but it still knows to print that error message. If I ssh, I want the output to be:

...connection lost

Anybody know a command so deadly, that upon running it, the OS will instantly crash to an unrecoverable state and corrupt everything? Could this command even exist? is the linux kernel designed for this?

148 Upvotes

171 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Mar 22 '22

As long as you run it on a folder you have control over, and know it contents there is no issue.

The problems start if running it recursive on / or other system folders like sbin, bin, dev and so on

3

u/[deleted] Mar 22 '22

[removed] — view removed comment

1

u/[deleted] Mar 22 '22

[removed] — view removed comment

1

u/space_wiener Mar 22 '22

What does the first do differently?

→ More replies (0)