[Cialug] repeat w/ sudo

Matthew Nuzum newz at bearfruit.org
Tue Mar 2 11:12:59 CST 2010


On Tue, Mar 2, 2010 at 11:07 AM, Thomas Kula <kula at tproa.net> wrote:

> On Tue, Mar 02, 2010 at 11:04:54AM -0600, Matthew Nuzum wrote:
> >
> >    What's  the  simplest,  shortest,  easiest to perform, whatever way to
> >    repeat the last command but with sudo in front of it?
> >    currently I up arrow, ctrl + a then type sudo [space] [enter].
> >    It seems like something so common should have a keyboard shortcut.
>
> I tend to do:
>
>  $ command_i_should_have_ran_with_sudo (grumble when I don't remember to
> use sudo)
>  $ sudo !!
>
> See if your shell has "!!", or the equivalent (I appear to have
> it on bash on one machine here, and tcsh on another).
>

Ah, it works! That's a good tip, thanks!

-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin, identi.ca and twitter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/cialug/attachments/20100302/c59a8063/attachment.htm 


More information about the Cialug mailing list