March 3, 2021

soltveit.org

..Geekish..

Dangerous Linux Commands

Dangerous Linux Commands

Dangerous Linux Commands

Dangerous Linux Commands my top 5 list. These should be used with caution, and not unless you know what you are really doing. If you have access to virtual machines, of course go ahead and try them out. You will learn from that. Could always fire up VirtualBox. It is free and easy.

My list of Dangerous Linux Commands.

1. rm -rf

This is the ultimate dangerous linux command. One little typo here and you hard drive is wiped totally clean. What this command does is to remove or delete a folder recursively. Sub-folders, empty folders. Everything. If you type rm -rf . that will delete everything from your folder where you are now. Type rm -rf / and your disk is clean. This actually mean delete the root drive and all sub-folders. Use with caution.

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

Might not even look as a command. But what this does is create two processes. One in the background and one in the foreground. And it will keep on call it self and multiply until your system runs out of resources, like Ram and CPU, and the crash.

3. mv folder /dev/null

This command will move your specified folder to null. That means it will delete it. So if you try mv /home/john /dev/null, Johns home folder will be gone.

4. mkfs.ext3 /dev/sda

mkfs.ext3 /dev/sda command means that the device sda will be formated as a ext3 partition. Your data will be gone, unless it is used intentionally. Well, it will still be gone, but thats what you wanted. Sda is usually your primary partition on a Linux system.

5. > file

If emptying the file is your goal use > file. Can of course be useful if you want to delete all the content of a file. Without deleting the file just to re-create it again.

A short and funny list of Dangerous Linux commands. Dangerous commands should be used with caution. Unless the result is intendant.

Debian linux can be found here: https://www.debian.org

Happy danger.