The Deadliest Commands you Should never Run on Any Linux Computer

The Most Deadliest Command you Should never run on Linux

Are you a Linux genius ? if you are then you know how much Linux commands are powerful and on top of that unlike other operating systems Linux won't ask you for confirmation if you are about to run a time bomb command that can blow your system.
I can't imagine how much damage you can do to your system if you run a command that destroy system or do other unexpected things , so i thought giving you guys these command will help you in the future to know what kind of command you are about to run
 and so preventing you from doing what you didn't want to do , learning the command you shouldn't run can help protect you form trolls in the mean time increase your knowledge of how Linux works .
However many of these commands will only be dangerous if they’re prefixed with sudo on Ubuntu , they won’t work otherwise. On other Linux distributions, most commands must be run as root.

rm -rf / – Deletes Everything!
rm -rf .* would delete all your configuration files.
rm rf ~ would delete all files in your home folder

The command rm -rf / deletes everything and by everything i mean everything, and this include files on your hard drive and files on connected removable media devices EXTERNAL HDD,FLASH DRIVE and so on.
Let see what each of those two combined command means
    rm – Remove the following files.

    -rf – Run rm recursively (delete all files and folders inside the specified folder) and force-remove all files and this will happen without prompting you.

    / – Tells rm to start at the root directory, which contains all the files on your computer and all mounted media devices, including remote file shares and removable drives.

When you run this command Linux execute the command as you wish that mean deleting everything without even warning you of the possible result of you actions. so be careful whenever your finger are tempted to type and run this command .

Here’s another snippet of code that’s all over the web that i thought you should be ware of:

    char esp[] __attribute__ ((section(“.text”))) /* e.s.p
    release */
    = “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68”
    “cp -p /bin/sh /tmp/.beyond; chmod 4755

This one is the hex version of rm –rf / –executing this command would wipe out your files just like rm –rf / does.

The thing is when you see easy and innocent looking commands like the ones bellow you won't think that they can do anything bad
but don't underestimate them these command are as bad as the one mentioned above .

:(){ :|: & };

What this innocent looking command does is that it defines a shell function that create new copies of it self. and the process continually replicate itself and also it copies continually replicate themselves continually taking up all you CPU time and memory.
 and you don't have to be a tech genius in order to know this process can cause your pc to freeze completely .

mkfs.ext4 /dev/sda1 – Formats a Hard Drive

The mkfs.ext4 /dev/sda1 command is simple to understand:

    mkfs.ext4 – Create a new ext4 file system on the following device.

    /dev/sda1 – Specifies the first partition on the first hard drive, which is probably in use.

When used together this command act the same way as if you are running format C: on windows. This one will wipe all files on your first partition and then replace them with a new file system.

Here is another form of this command: mkfs.ext3 /dev/sdb2

This one when executed will format the second partition on the second hard drive with the ext3 file system.

There is another thing I would like to mention, don’t run command directly on hard disk devices that begin with /dev/sd.

command > /dev/sda – Writes Directly to a Hard Drive

This command runs a command and sends the output of that command directly to your first hard drive, and thus writing the data directly to the hard drive  and damaging your file system . This one also is among the time bomb command that you should not tamper with .

 Send the output of the command to the following location.

 /dev/sda – Write the output of the command directly to the hard disk device.


Be careful don’t run such command that involves devices beginning with /dev/sd.
dd if=/dev/random of=/dev/sda   Writes Junk Onto a Hard Drive

The dd if=/dev/random of=/dev/sda   this command obliterate the data on one of your hard drives.

    dd   this command Perform low-level copying from one location to another.

    if=/dev/random    Use /dev/random (random data) as the input   you may also see locations such as /dev/zero (zeros).

    of=/dev/sda   this command Output to the first hard disk, replacing its file system with random garbage data.

mv ~ /dev/null   this command what it does is that it Moves Your Home Directory to a Black Hole what a black hole think of it as the black hole in our galaxy because they act the same way , means moving something to /dev/null is the same thing as destroying it completely or is the same as moving something in the galaxy’s black hole. So mv ~ /dev/null sends all your personal files into a black hole.

/dev/null   Move your home folder to /dev/null, destroying all your files and deleting the original copies.

/dev/null is another one that you should stop your fingers from typing because executing it moves your home folder to /dev/null, thus destroying all your files and deleting the original copies so this is your worst nightmare you definitively don’t want to have this kind of nightmare do you?  Yeah that what I thought.

Another thing to mention is don’t and I mean don’t run untrusted scripts , here is a line of code that download a script from the web and send it to SH,

wget ]]>]]> -O – | sh

the wget downloads a file and ]]>]]> is the location of the file that will be downloaded and the | or the pipe sends the output of the wget command in this case the file you downloaded from ]]>]]> directly to another command.

The sh in the other hand sends the file downloaded to the sh command and executes it if it’s a bash cript.

and after being sent the sh will execute the contents of the script well I don’t have to tell you how dangerous running a script that you don’t know anything of what it can do can be to your system.
That it fox, that some of the most dangerous Linux commands that can make your life miserable if not used properly any ways knowledge is power, so after reading this something like that can never happen!


Share This Story

Subscribe to

Keep Up with Technology! Our news to your Email

About Author

A Technology enthusiast, developer and content maker that wants to keep you in the loop of that i keep an eye on. Let's Tech