rm -rf /* disaster that hit me a couple of weeks ago I’ve
been rebuilding my setup, restoring the few files I’ve had backed up,
and collecting advice from the elders.
Turns out there are a few tricks that can save your home directory from accidents like mine. The first one is rather obvious, but I’m writing it down anyway:
- Keep separate accounts. If possible, use separate accounts (with different permissions obviously) for different projects. I had my private life and work life mixed up, so that’s a big no-no to begin with.
- Create a file called
The last bit of advice I’d heard about earlier, about ten years earlier,
but completely forgotten about. The trick is to create a file that will
be interpreted by
rm as an unknown option. For GNU
-t is a
Here are two ways of creating such a file:
cd touch ./-t
or, the perhaps easier to remember:
touch -- -t