Since my comment that I accidentally ran

rm -rf /*

on a NASA server got some attention, I thought I'd explain a bit.

First, I think the actual command I ran (~22 years ago) was:

rm -rf . /*

Now here's why...

Something had created a file with a name starting with - such as -results or similar.

Unix shells interpret the glob as part of the actual command, so rm saw "rm -rf -results file1 file2 file3..."

and it threw an error from an unknown flag.


· · Web · 1 · 3 · 6

So the straightforward way to handle this is to simply run:

rm ./*

which deletes all the files in the current directory.

-rf is known to most people. It just means "recusively delete everything without prompting"

The extra space was a typo.

And yes, running that blew the server away, even though I caught it and Ctrl-C.

We had regular backups and I simply had to shut the host down and restore it from backup. The user data was not affected (luckily) as it lived on external nfs storage.


Yup. It was apparently common enough, and also no one really needs to delete / except in possibly the most odd circumstance.

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!