We keep on listening that there are dangerous commands in Linux/Unix and are advised not to run those commands. One of those deadly command combination in Linux is “rm -rf /“. Though “rm” is a normal Linux command which we use daily to remove files, but when it is used on root filesystem with “-rf” option it becomes destroyer of operating system.
There is nothing much in explaining this article and this article is crystal clear with its title. I am sure you must be knowing about “rm” command. It is used to remove files or directories in Unix / Linux distros.
Below is the single command which I used to destroy the whole Linux operating system, with its switches or options. I have used -v switch to show what is happening in terminal, otherwise we don’t have any idea what’s going on.
rm -rf /
-r: recursive
-f: force
-v: verbose
When I first ran “rm -rf /”, Kali Linux gave me an error and ask to use “–no-preserve-root” switch with the rm command.
Kali Linux is a very intelligent operating system and does not allow to run “rm -rfv /” command even by mistake and gave that warning.
Then I ran “rm -rfv –no-preserve-root /” and the command was executed successfully.
Just in few minutes whole filesystem hierarchy was deleted and nothing was visible. Once the whole Kali Linux operating system is down, you will see grub error as below.
error:file '/boot/grub/i386-pc/normal.mod' not found Entering rescue mode... grub rescue:
So let’s don’t talk anymore and just watch below video. Hope you will like it.
Note: Do not run this command on production environment.
Do let us know what are your views about this video and provide your feedback. Also, do let me know if you have ever tried running “rm -rf /” on any UNIX/Linux distributions. As always, do not forget to share this article and video and do subscribe to my YouTube channel and this blog.
Philippe
I tried it once on a dummy virtual machine to see what will actually happen and guys, did it mess everything up… lol now I know how dangerous it is.
Never make that mistake on production site (you’re getting fired) and I’d go as far as advising people to type slow when they use #rm -rf on anything.
Good day! π
Pawan Bahuguna
Thanks Philippe for your advice. It is very dangerous command and your production environment can be blown in just few minutes.
Philippe
If you catch it fast enough with Ctrl+c, you might save the most critical stuffs like certain commands but there’s a great chance the system will still be damaged.
By the way, thanks for your book. It’s awesome!
Pawan Bahuguna
Yes Philippe, you are right and thanks for appreciating the book. Hope you have already reviewed it on Amazon. π
Philippe
Yes, I did!
Pawan Bahuguna
Thanks a lot buddy and do practice a lot for RHCE. Good luck!
Philippe
Thank you, sir!!
Pawan Bahuguna
Thank you for the review.