That's my theory as to what they did.
rm -Rf test /
rm: it is dangerous to operate recursively on ‘/’
rm: use --no-preserve-root to override this failsafe
GNU rm, but I don't know when it was introduced.tl;dr That's when coreutils Ubuntu package switched from "--no-preserve-root" to "--preserve-root" by default.
edit: More info:
Remove write access to the parent directory, while keeping traversal and read rights, and you'll be sorted.
# touch /tmp/foo/.immutable
# chattr +i /tmp/foo/.immutable
# rm -rf /tmp/foo
It's not EXACTLY what you asked for, but the .immutable file cannot be deleted until you call chattr -i on it, which protects the directory....
it's one thing to shoot yourself in the foot, but without safe-rm you (or someone else less cautious) will eventually fire the accidental head-shot. it's happened to me a couple times; but never again since I started using safe-rm everywhere.
[1] http://serverfault.com/questions/337082/how-do-i-prevent-acc...
Under some shells (eg bash) that will expand to include `..` and `.`.
Hopefully, it was not at the root directory and we have frequent snapshots.
Edit: What would have been much more worse, if I had done it, would have been
rm -rf ~ /foo
instead of rm -rf ~/foo rm -rf /usr /lib/modules/something/somethinghttps://www.wired.com/2001/11/glitch-in-itunes-deletes-drive...
You can use the `Pathname` class to treat paths as objects, which you can concatenate only valid paths with. Aside from obviously all the other sanity-saving features.
I'd love to see someone deploy a Python or Ruby-based shell. I'm sure these are available, but they're not widely used.
And I'm quite happy not having shell use hold back evolution of Ruby or Python, and not having drama like Ruby 1.8 -> 1.9 or Python 2.x -> 3.x affecting shell use.
> The command that had been run was most likely ‘rm -r -f *’, which—roughly speaking—commands the system to begin removing every file below the current directory. This is commonly used to clear out a subset of unwanted files. Unfortunately, someone on the system had run the command at the root level of the Toy Story 2 project and the system was recursively tracking down through the file structure and deleting its way out like a worm eating its way out from the core of an apple.