Aliasing rm to rm -i for sudo

Markus Kolb ubuntu-ml at
Mon Jun 20 20:45:15 UTC 2005

Matthew S-H wrote on Mon, Jun 20, 2005 at 16:04:23 -0400:
> On Jun 20, 2005, at 11:32 AM, Markus Kolb wrote:
> >Matthew S-H wrote on Mon, Jun 20, 2005 at 10:24:47 -0400:
> >>try adding:
> >>alias "sudo rm"="sudo rm -i"
> >
> >That's an invalid alias name. "sudo rm" can't be a command.
> Works fine for me...  Can anyone else confirm this?

Which shell do you use?

$ alias "sudo rm"="sudo rm -i"
bash: alias: `sudo rm': invalid alias name

Out of man 1 bash:
Aliases  allow a string to be substituted for a word when it is used as
the first word of a simple command.  The  shell  maintains  a list  of
aliases  that  may  be set and unset with the alias and unalias builtin
commands (see SHELL BUILTIN COMMANDS below).  The first  word  of each
simple  command, if unquoted, is checked to see if it has an alias.  If
so, that word is replaced by the text of the alias.

More information about the ubuntu-users mailing list