7 commands you should never run on Linux

7 commands you should never run on Linux

Published Aug 30, 2026, 12:30 PM EDT Faisal Rasool has been a feature writer at How-to Geek since early 2024. He brings years of professional experience in simplifying technology for his readers on topics like mobile devices, PCs, and online privacy. He tries to help people get the most out of their gadgets and software with the least effort. In his teenage years, he spent hours every day tinkering with Android phones and Linux builds. Faisal started his career at WhatMobile in 2019 (mostly out of his obsession with Android) where he published over 2,000 news stories. Currently, he contributes to the news section over at AndroidHeadlines. He also authored more than 100 feature articles for SlashGear, covering Android, iOS, Web, Chromebooks, online privacy/security, and PC content. Faisal has a Bachelor's in English literature, and loves to read and write. He also loves watercolors, retro video games, animation, and cats. The best thing about Linux is that it respects its users. It does exactly what you tell it to do. Want to kill a program? Send the kill command and it'll be terminated without warning. However, the worst part about Linux is also that it does exactly what you tell it to do. Here's what I mean. The old "remove the French language pack" trick A true classic There's a meme online where people claim to help you remove the French language pack from your Linux machine with this command. sudo rm -fr --no-preserve-root Or this command: sudo rm -fr /* What it actually does is wipe your entire computer—the entire operating system and every single file on every single connected drive. Linux beginners often fall for pranks like these. Apparently, even Google's AI overview fell for it. It's prevalent enough that Linux developers had to build a safety mechanism that prevents the root directory from being deleted. The "-no-preserve-root" part of the command overrides that safety check. Here's how the command actually works. The "sudo" part means that you're telling Linux to run this command with superuser privileges. The "rm" or remove command deletes files without warning and directly (no Recycle Bin here). The "fr" or "rf" flag makes sure the remove command keeps running recursively from the root of the file system to the last file and folder. That's what the "/*" in the command represents—it's pointing to everything in the root directory. The 777 command More unlucky than it sounds In Linux file systems, every file and folder has specific permissions. Some files are ready-only, others are writable or editable, and others can be run as executable files. The "change mode" or "chmod" command lets you modify those permissions for any given file or directory. Most of the time, you use it to make files executable or writable. However, there's a dangerous command that uses "chmod" to make every single file on your system executable and writable to any user or process. sudo chmod -R 777 / The "sudo" runs the command with superuser privileges. The "chmod -R 777" command recursively gives read, write, and execute permissions. The slash at the end tells the command to target the root directory and work its way through every directory. It doesn't break the system right away, but many system programs that rely on specific permission configuration stop working. Your machine is instantly compromised because any process can now see and edit sensitive files like passwords or configs. The computer might not even boot. There's also no way to undo this command. If you run it, you will have to reinstall your operating system to get your files back to normal. Deleting all cron jobs Uh oh! Linux handles automated system tasks like file cleanup, updates, and maintenance through something called "Cron jobs." These scheduled tasks run automatically, but there's a command that can remove all system Cron jobs and bork your OS. sudo rm -rf /etc/cron.d/* The emoticon bomb It's kinda cute, at least This command looks like a bunch of emoticons, but running it will instantly crash your computer. It might freeze first and become unresponsive, or even shut down. :(){ :|:& };: It's called a Fork Bomb. Here's what it does: :() creates a function and this function is enclosed in the parentheses {}. The pipe ":|:" makes it run the function recursively. The "&, ; and :" trigger the process and move it to the background so it cannot be terminated easily. You won't be able to save your work once this command starts, and you'll probably need to reboot to get your computer back to normal. The Find command that erases everything permanently Find yourself with nothing This command begins with "find," which makes it seem like you're just running a simple search when it's actually incredibly destructive to your system. sudo find / -type f -exec shred -n 5 -z -u {} + It erases all the data on your device, including the whole operating system, and it's impossible to recover any of it. The "find / -type f" looks up every single file, starting from the root directory and working forward. The "-exec" executes the "shred" command next to it. "Shred" is a Linux utility that deletes files and overwrites them with random data so they cannot be recovered without a backup. The "-n 5 -z -u" flags repeat that overwriting process more than five times to make sure every trace of the files and any evidence of the shredding process is gone. Disk destroyer A common mistake Data duplicator or 'dd' is a Linux utility, mostly used for burning or cloning disks and making bootable USB drives. Data duplicator interacts directly with drives instead of the file system, so you need to know exactly what you're doing, or you risk serious data loss or corruption. It has the nickname 'disk destoryer' because it has zero guard rails or security checks. People often accidentally wipe their drives or entire operating systems with "dd," which has earned it the notorious nickname. For example, running a command like this will delete everything on the drive with no possibility of recovery. dd if=/dev/urandom of=/dev/sda Instant kernel panic Situation normal, computer down To protect your files and hardware from errors that can damage them, Linux has a safety valve that kicks in and instantly shuts down the computer. It's called a kernel panic. Windows does something similar with its Blue Screen of Death or BSOD. There's a command that can instantly trigger a kernel panic and crash your computer. sudo bash -c 'echo c > /proc/sysrq-trigger' It writes the word "c" to a critical system file which triggers an unrecoverable error and leads to a kernel panic. Learn the basics of the terminal and you'll avoid crazy mistakes Before entering a command or running a script, be sure you know exactly what it does. It's never safe to run unknown commands off the internet because it might crash your computer or erase everything without warning.

Original Source

Read the full article at Howtogeek →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.