Aliasing rm to rm -i for sudo
Markus Kolb
ubuntu-ml at tower-net.de
Mon Jun 20 20:52:16 UTC 2005
Markus Kolb wrote on Mon, Jun 20, 2005 at 20:23:18 +0200:
> Michael Beattie wrote on Mon, Jun 20, 2005 at 11:51:58 -0400:
> > On 6/20/05, Markus Kolb <ubuntu-ml at tower-net.de> 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.
> > >
> >
> > you could do
> >
> > alias sudo_rm='sudo rm -i'
> >
And and even more simpler solution which need not work with every shell
but does in bash and ksh:
alias sudo="sudo "
There must be a space behind the sudo in quotes and then the first word
after the alias on input becomes substituted if an alias for this word
is available.
More information about the ubuntu-users
mailing list