10 Most Dangerous Linux Commands

Largest Military hacking

Guys, we all know what is Linux. Linux is a free and open source operating system based on Unix clone. Developed by Linus Torvalds. There are various Linux distributions commonly called as “distros”. Some of the famous distros used nowadays are Red Hat Linux, Ubuntu Linux, Fedora, Debian, Linux Mint. Today, we’ll see 10 most dangerous Linux commands.

A shell program is used to run the Linux commands and showcase the appropriate output. It is called “Terminal” in the Linux operating system. To open terminal, press Ctrl+Alt+T in Ubuntu. Some basic Linux commands include pwd, ls, cd, mkdir, rm, etc. Now, let’s take a look at some of the dangerous commands you should not try at business or enterprise work.


1. rm -rf/

This command is used to delete a folder and its content. But a small error in typing or ignorance results in unrecoverable damage to the system. This command can delete everything possibly can, including files on hard drive and files on connected removable media devices. Thankfully, many Unix system has placed a safeguard into the rm command to ensure that it doesn’t happen accidentally or unintentionally. Some of the options used with rm command are:

rm - It removes everything.
-rf - It will run rm recursively.
/ - It will tell rm to start at the root directory.

2. Command > /dev / sda

This command writes the output of ‘command’ on the block /dev/sda. If we run this command then the output of the command will be written on the hard disk. So hard disk can damage your file system. The raw data is replaced with the file blocks in the system which results in data loss in the block.

Command – Run a command
/dev/sda – write the output of the command directly to HDD.

3. : () {: |: &} ;:

This command is basely called as a fork bomb in Linux. This command works by itself defining a function and restarts until the system is running. It repeats itself multiple time until the system freezes. Which results in a frozen computer. Once executed then the only chance is to restart the system. The BASH functions are powerful, even very short ones.

4. mv / /dev/null

If anyone tired of hearing ways to wreck their hard drive. Then get ready there’s a special file called /dev/null that will discard whatever data is written to it. One should think of it as Trumpet pitchers which are the flowers which insects, means whatever given to it as an input will be eaten up for good.

Here the (mv) move the system’s root directory into the mouth of monster /dev/null.
mv – Move the following file or directory to another location.
/dev/null – Move your home folder to dev/null, Destroying all your files.

5. Command> file.conf

This command is used to release the file content. If the command is typed with an error as “>ab.conf” will write the configuration file or any other system or configuration file. Means if the redirection feature of BASH is not used carefully will result in the wiping out an important configuration file. That’s why one should always check the commands before executing it on own system.

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

Linux is very much secured. But, there are some kernel issues and internal errors too. Which results in the data lost on the hard drive whose recover is not possible, so the system will enact something similar to Blue screen in windows, here it is Kernel panic. Which forces to reboot the system.

It’s best to stay away from these commands unless you’re absolutely sure you know what you’re doing. Your system would be left in an inconsistent and unrecoverable phase.

Dd – Perform Low-level copying.
If=/dev/random – Use /dev/random as the input.
Of=/dev/sda – Output to the first HDD.

7. ^foo^bar

This command is very useful as well as very interesting also as it is used to edit the previous run command without the need of retyping the whole command again. But this can really be troublesome if you didn’t take the risk of thoroughly checking the change in original command using the ^foo^bar command.

8. mkfs.ext4/dev/sda1

The above command will format your ‘sda1’ block and you will definitely know that after running the above command your HDD will be reset to NEW, without leaving the data.

mkfs.ext4 - create a new ext4 file system
/dev/sda1 – Specifies the first partition on the first hard drive.
9. wget [Website]_source -0 | sh

In short, the above command will download a shell script from an untrusted source and run it when the download finished. A script downloads from web and pipes it to sh, which executes the contents of the script. It is risky if you’re not sure what the script is or if you don’t trust its source.

wget – Downloads a file.
http://example.for/you - Download the file from this location.
| - Sends the output to the wget command.
sh – Send the file to sh command, which executes it if it’s bash script.
10. bombzip untrusted .gz

The rarely known Decompression Bomb is pretty unique in its approach. If you received a compressed file and need to extract that file which appears to be very small in size but maybe a few KB. Instead, that small size compressed file the contains very highly compressed data. If you decompressed that file and hundreds of GB of data are extracted which can fill up your HDD to bring down the performance of your system. For that reason, decompressing any untrusted file can be very dangerous, So always remember to accept data from trustworthy sources.


So, here we observed some of the very dangerous Linux commands. Surely there are many more commands which are there that are harmful to our system. So be careful and do check before running such commands on your system.

Pranav Sahare

Pranav has been put on board to help out with Research-based Quality Content of the latest technology trends around the world.

You may also like...