I was a teenage intern, and my software engineering team was crunching in the evening on a project, when there was a problem on a workstation.
The sysadmin was gone for the day, so I was asked for help.
I saw the root filesystem was full, partly due to a bunch of junk files in `/tmp/`, including some files/directories that started with `.`...
You might guess where this is going, when someone hadn't yet developed good intuition for what was safe and not. At some point in cleaning up (and not having filename completion in that shell), I cavalierly typed:
rm -rf .*
When the command was taking too long, I got a sinking feeling, and hammered Ctrl-C, while in parallel realizing exactly why it was taking so long. (Spoiler: `.*` matches `..`, so `rm` went up the filesystem tree, to `/`, and then tried to go depth-first traversal through the entire tree.)
It gets worse. This wasn't just a workstation -- this was a Sun Workstation, in the era of "the plethora of NFS dependencies is the computer". IIRC, either `rm -rf` started following the NFS automounter symlinks, to delete files from servers that it could, or an ad hoc NFS server had been set up on that workstation for some team purpose. Either way, `rm` hit files shared by multiple people, who were already working into the evening on a project.
It was the fault of the intern, who was both inexperienced and overconfident, and my team was really nice about it. Maybe they knew I regretted it so hard that, if I survived the next few minutes, I'd still regret it many years later.
Out of all the stories I've read in this post so far this one filled me with anxiety the most. If this happened to me I don't think I'll ever forget it.
I've had to clean up after some incidents like that. There was one where an accidental recursive delete was running for several hours traversing a bunch of mounts. root was mapped to nobody so it could only delete from world-writable directories but that was bad enough. It was on Netapp filers so it wasn't too hard to restore from snapshots but it took us a while to find the culprit. There was a lot of traffic from many machines so it wasn't trivial to figure out where the REMOVE calls in question were coming from.
The sysadmin was gone for the day, so I was asked for help.
I saw the root filesystem was full, partly due to a bunch of junk files in `/tmp/`, including some files/directories that started with `.`...
You might guess where this is going, when someone hadn't yet developed good intuition for what was safe and not. At some point in cleaning up (and not having filename completion in that shell), I cavalierly typed:
When the command was taking too long, I got a sinking feeling, and hammered Ctrl-C, while in parallel realizing exactly why it was taking so long. (Spoiler: `.*` matches `..`, so `rm` went up the filesystem tree, to `/`, and then tried to go depth-first traversal through the entire tree.)It gets worse. This wasn't just a workstation -- this was a Sun Workstation, in the era of "the plethora of NFS dependencies is the computer". IIRC, either `rm -rf` started following the NFS automounter symlinks, to delete files from servers that it could, or an ad hoc NFS server had been set up on that workstation for some team purpose. Either way, `rm` hit files shared by multiple people, who were already working into the evening on a project.
It was the fault of the intern, who was both inexperienced and overconfident, and my team was really nice about it. Maybe they knew I regretted it so hard that, if I survived the next few minutes, I'd still regret it many years later.