Aliasing rm to rm -i for sudo

Matthew S-H mathbymath at aol.com
Mon Jun 20 14:24:47 UTC 2005


On Jun 20, 2005, at 4:16 AM, R (Chandra) Chandrasekhar wrote:

> Dear Folks,
>
> I have aliases for rm to be rm -i in the .bashrc files for an  
> ordinary user as well as for root so:
>
> alias rm='rm --interactive'
>
> When I do rm <filename> as an ordinary user, I am asked to confirm  
> deletion.
>
> Likeweise, after sudo -s -H, when I do rm <filename> I am asked to  
> confirm deletion.
>
> However, if I do sudo rm <filename> deletion proceeds without  
> interactive confirmation.
>
> How may I alias rm to rm -i for sudo?

try adding:
alias "sudo rm"="sudo rm -i"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050620/68f12e57/attachment.html>


More information about the ubuntu-users mailing list