This afternoon, about 10 minutes before the end of the day, one of the undergrads working in my lab turned to me and asked what the command to undo an rm command was. I blinked at her, and told her there was none. I’m now trying to sift through a disk image dumped from the machine she worked on after typing rm -r * in the wrong terminal. Now, backups, backups, etc. I know. But even with regular backups, an rm -r * in your home directory is never fun. If you want to not experience the joys of watching your files turn to dust, add this to your .bashrc:
alias rm="rm -i"
This won’t save you every time, but it will at least prompt you before you blow away 3 weeks of work. So don’t ignore the prompt. Please?