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


Click here to return to the 'good idea, but wrong way to do it' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
good idea, but wrong way to do it
Authored by: pmbuko on Oct 15, '02 02:08:00AM
This is was shell configuration scripts are for. If you use tcsh, open or create a file called .tcshrc. If you use bash, open or create .bash_profile or .bashrc. Add the following line:

alias rm='rm -i'

After you've saved your shell profile, you must close the current terminal window and open a new one for the changes to take place.

I'd advise against using file names beginning with a '-', as any command run with a wildcard on the directory containing that file will interpret it as an option (as mentioned above).

As a side note, once you've created the rm -i alias, you can bypass it when you're sure about what you're deleting precedign the command with a backslash:

> rm filename

This trick works to bypass all aliases.

[ Reply to This | # ]