rm -rf Mint

For expert users of Linux and other UNIX-like operating systems, the command line is where the action is. We (they) claim that stuff gets done faster and easier on the command line than pointing and clicking on a fancy graphical interface.

While that may, to a very large extend, be true, the command line can be a scary place for new users. What do you do at the command line if you do not know what command to type? That may account for why new users shy away from the command line.

Typing the wrong command can severely cripple your computer. A wrong switch or wrong option is all it takes. One command that I learned to avoid a long time ago, based on what experienced users told me, is rm -rf /. The rm command is what you use to remove or delete a file or directory. By itself, rm will delete a file. With the -r or -R option, it will recursively delete a directory. The -f option will force the action. So, you can imagine what rm -rf / could theoretically do to you your system. But will it?

Related Post:  How to set up a Debug Server using Nginx

I never really bothered to find out for myself until prompted by a response to a comment by a reader on this article. Here is what I learned.

Typing the command in PC-BSD generated the response shown in this image. No harm done.
rm -rf PC-BSD

Same in Fedora.
rm -rf Fedora

And in Linux Mint.
rm -rf Mint

So, typing rm -rf / will not play pacman with your data, unless you override the – -preserve-root option, which is the default. Note that typing the command with the – -no-preserve-root option as a standard user, will delete everything that you have permission to delete. That means almost everything in your home directory. As root, it will continue to chew up any file it encounters until your screen looks like the image below, eventually turning completely dark. Do not try it, unless you want to have a very, very bad day, or, like I did, on a test installation.
rm -rf Root

Related Post:  Just a few tricks to make you more efficient at the command line

In the beginning, when dinosaurs roamed freely, it is likely that rm -rf / actually did screw up a computer. But that could only have been true if – -preserve-root is a recent addition to the command’s options.

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.