Hacker News new | ask | show | jobs
by rwallace 4173 days ago
As a more immediate fix with less collateral damage, since Unix programmers refuse to stop putting `rm -rf` commands in shell scripts (they seem to think the suggestion is an insult to their manhood), change the behavior of rm so that by default it either disregards -rf or moves the target files to a trash directory where they can be retrieved in the event of an error.
2 comments

A simple alias would work as a quick fix:

    alias rm='rm -I'
With the -I flag, rm asks the user before removing multiple files or removing recursively. One of the top in my aliases file.
Already exists - libtrash.