Arduino (1) Bugs (3) C (1) Install (3) Linux (25) Maths (1) Python (11) Raspberry Pi (4)

Monday, 19 September 2016

5 commands you should NOT run.

If you do want to test them out you can check out this tutorial on installing vmware and run them inside a VM just for fun.

A list from this reddit post for people to post the most dangerous/annoying commands they can come up with.

The Classic Fork bomb:
Posted by cuba200611
This line crashes your system as it uses up all the resources. It works by creating a function which calls its self twice and has no way of terminating it's self. This quickly uses up all the resources and crashes your PC.

:(){ :|: & };:

Delete your whole hard drive:
This line deletes everything from the hard-drive when run as root.

rm -fr /

Break your CD drive:
This line constantly ejects your CD drive not allowing it to shut.
Posted by wee0x1b

while true; do eject; done

Overwrite you hard drive:
This line writes zeros to your hard drive
Posted by Celtore

dd if=/dev/zero of=/dev/sda

Chmod killer:
Posted by: therancor91
Explanation from gigolo_daniel:
For those wondering why this breaks your entire system giving you execution permission errors everywhere while prima facie it merely seems to add permissions, the primary reason is that it removes setuid and setgid bits on executables if you change permissions like that. These mode bits when an executable is ran run it under the permission of the owning user and owning group respectively, not the user who executes it. This is typically used with a lot of executables to allow a temporary elevation of privileges which is needed for a surprisingly large number of operations.

You can no longer normally become root after you done this because both sudo and su use the setuid bit to enable a login as root.

chmod 777 /

All of these commands show the true power of a one line command which could destroy your system, be careful when copying commands.