1

I am trying to create some alias for executing the same command but with sudo credentials. In the ultimate case I want to be something like:

alias !!='sudo !!'

But when I source /.bashrc file this particular alias doesn't work for some reason.

1 Answers1

-1

aliases cannot have arguments, use a function:

function SU { sudo $*; }
ingopingo
  • 807
  • when you say aliases cannot have arguments, are you saying something like alias l="ls -FC" is invalid? – ron Feb 23 '17 at 18:28
  • 1
    The alias in your example is l. Sure, it use arguments but itself has none. Try to define a alias for a find -user self -print with a directory as argument. – ingopingo Feb 23 '17 at 18:37