View previous topic :: View next topic |
Author |
Message |
Yamar n00b
Joined: 08 May 2004 Posts: 14
|
Posted: Mon May 17, 2004 4:18 pm Post subject: bash warnings? |
|
|
Is there any way to enable warnings for rm, cp, mv etc. in bash? For example if I do a:
rm foo
it will ask if I'm sure I want to remove the file before removing it.
I've had this in other distros. How do I enable it in Gentoo?
I've searched the forums and google and didn't find anything on this.
TIA |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Mon May 17, 2004 4:37 pm Post subject: |
|
|
Basically you've got to look up in the manpage ("man cp" etc.) how to have it ask for confirmation and then add an alias for it. Putting it in ~/.bashrc makes it available automatically.
I don't know how other distros accomplish this, but I'm pretty sure they just put something like
Code: |
alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"
|
in /etc/skel/.bashrc.
You want to add the above to /home/<your-username>/.bashrc |
|
Back to top |
|
|
Voltago Advocate
Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Mon May 17, 2004 4:37 pm Post subject: |
|
|
Add to your /etc/profile the line
|
|
Back to top |
|
|
Yamar n00b
Joined: 08 May 2004 Posts: 14
|
Posted: Mon May 17, 2004 4:51 pm Post subject: |
|
|
Thanks for the fast replies! It's working now |
|
Back to top |
|
|
|