Jump to content

9 Lethal Linux Commands You Should Never Run


securitybreach

Recommended Posts

securitybreach

Delete Recursively

 

The Linux ability to delete anything you want without question is a godsend, especially after dealing with years of “That file can’t be deleted” errors in Windows. But Internet trolls will be quick to deceive you, presenting you with extremely dangerous removal commands that can wipe entire hard drives.

 

rm -rf /

 

This line executes the remove command rm with two toggles: -r which forces recursive deletion through all subdirectories and -f which forces deletion of read-only files without confirmation. The command is executed on the / root directory, essentially wiping your whole system clean.

 

Note, these days on most Linux systems if you tried doing this you’d get a warning. But the warning isn’t guaranteed, so just don’t do it.

 

Format Hard Drive

 

The terminal is especially tricky for Linux newbies because it provides several ways to accidentally wipe one’s hard drive. Recursive deletion is a big one, but here’s another:

 

mkfs.ext3 /dev/hda

 

This command formats the hard drive to use the ext3 filesystem. Disk drive formatting is not an inherently malicious action, but it does “reset” the drive such that it’s “as good as new”. In other words, a formatted hard drive is like a blank slate.

 

Formatting is useful for disk partitions and external drives, but executing it on an entire hard drive (such as /dev/hda) is dangerous and can leave your system in an unrecoverable state.

 

Overwrite Hard Drive

 

As if accidental disk formatting wasn’t bad enough, it’s possible to overwrite your hard drive using raw data. At least disk formatting is an actual procedure with real-life uses; directly overwriting one’s drive, on the other hand, is not so great.

 

command > /dev/hda

 

In the command above, command can be replaced by any Bash command. The > operator redirects the output from the command on its left to the file on its right. In this case, it doesn’t matter what the output of the left command is.

 

That raw data is being redirected and used to overwrite the system hard drive.

 

As you can imagine, this renders it useless.

 

Wipe Hard Drive

 

Here’s another way to ruin your system. This time around, the command will completely zero out your hard drive. No data corruptions or overwrites; it will literally fill your hard drive with zeroes. A hard drive doesn’t get any more wiped than that.

 

dd if=/dev/zero of=/dev/hda

 

The dd command is a low-level instruction that’s mostly used to write data to physical drives. The if parameter determines the source of data, which in this case is /dev/zero, a special on Linux that produces an infinite stream of zeroes. The of parameter determines the destination of those zeroes, which is the /dev/hda drive.

 

Yes, there are legitimate reasons for zeroing a drive, but if you don’t know what those reasons are, then you’ll want to stay away from this command.

 

Implode Hard Drive

 

If you’re tired of hearing ways to wreck your hard drive, hang on. Here’s one more for you. On Linux, there’s a special file called /dev/null that will discard whatever data is written to it. You can think of it as a black hole or a file shredder: anything given to it as input will be eaten up for good.

 

mv / /dev/null

 

Can you spot the danger here? The mv command tries to move the system’s root directory / into the black hole of /dev/null. This is a valid command and the result is devastating: the hard drive gets eaten up and there’s nothing left.

 

Doing this will make your system unusable..............

 

http://javatview.blo...you-should.html

  • Like 2
Link to comment
Share on other sites

securitybreach

Now, you know, someone is just going to have to try those commands. ;)

 

I actually have in the past. Was fun watching VMs blow up.

  • Like 1
Link to comment
Share on other sites

securitybreach

:hysterical: :hysterical: :hysterical: :hysterical: :hysterical: ya godda do the homework before ya poke the terminal ...

 

Yeah, it's not wise to randomly run commands you found without knowing a little bit beforehand.

  • Like 2
Link to comment
Share on other sites

I once ran "rm -rf /" in a VM, forgetting about the fact that I had my entire /home directory shared to it! :oops:

No real harm was done, Just had to restore my work backups and re-install a couple of Steam games.

  • Like 1
Link to comment
Share on other sites

V.T. Eric Layton

Hello,

 

I'm reminded of the old Windows NT Rollback (filename: rollback.exe) command. Ah, I found a reference here.

 

Regards,

 

Aryeh Goretsky

 

That's the command they use at Walmart...

 

walmartrollback.png

  • Like 4
Link to comment
Share on other sites

Hello,

 

I'm reminded of the old Windows NT Rollback (filename: rollback.exe) command. Ah, I found a reference here.

 

Regards,

 

Aryeh Goretsky

That link was a real blast from the past.
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...