Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Prevent rm disasters' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Prevent rm disasters
Authored by: codeProle on Oct 03, '05 04:22:40PM

Why not just do this in your .bash_profile:

alias 'rm=rm -i'

Which will force a prompt for each and every file potentially affected by the command.

You can still get into trouble with sudo, but you're own your own there.

---
--
15" G4 TiBook 867MHz 768 MB 40 GB



[ Reply to This | # ]
Prevent rm disasters
Authored by: merlyn on Oct 04, '05 07:11:26AM

Bad idea to alias "rm" itself. Instead, create "del" as "rm -i", and get used to typing "del". The problem is when you type "rm" into a shell that is not aliased like that, you expect "-i" behavior, and it doesn't have it! oops! Big oops!



[ Reply to This | # ]