ashleyn
10 hours ago
The amount of times I've heard this story just makes me think rm was badly designed. Should not be this easy to nuke the entire system.
jerf
10 hours ago
It isn't anymore. From man rm:
--preserve-root[=all]
do not remove '/' (default); with 'all', reject any
command line argument on a separate device from its parent
The era of computing that the story claims to come from sounds like the late 1990s. By that time UNIX could have had that fairly easily; the resources were available. However at the time we were not that far off from the era where every byte counted, and there were a lot of people who had been programming for decades who were still in the mindset of "every byte is precious". In that era we still had the last few people running around claiming that writing code in anything other than straight, raw assembler was a waste of resources, though they were fading fast by that point. Anyone who has learned programming in an era of gigabytes may not understand just how expensive once upon a time even so much as a "nice error message" was, and every disk block of code that was going on to every system was a disk block unavailable for the user. UNIX used to be a lot sharper-edged than it is today.mmh0000
8 hours ago
That's a lot of needless typing; when you need to uninstall something, you can still use globbing to work around that annoying error message:
# rm -rf /*
</semi-sarcasm>yjftsjthsd-h
4 hours ago
I'd give 2 responses depending on what you mean by that:
1. As sibling comment notes, at least GNU rm does make some effort to protect you.
2. I would suggest that any further protection is just going to get in the way. For example, I've run into systems that aliased rm to `rm -I`:
-I prompt once before removing more than three files, or when removing recursively; less intrusive than -i, while still giving protection against most mistakes
but I almost always promptly override that because sometimes yes I do actually want to delete a lot of files in a lot of places and I am not having this argument with the machine.Or as has been put more elegantly:
“Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.” — Douglas Gwyn