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.
1/2
@emacsen rm is patched now so it requires an extra flag
Yup. It was apparently common enough, and also no one really needs to delete / except in possibly the most odd circumstance.
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.