Execute last command as superuser

Jun 12, '02 02:06:36AM

Contributed by: bhines

Isn't it annoying when you try to do something, only to find out it requires superuser privs? And you have to retype it with "sudo"? No more!

An easy trick (in tcsh) to perform the last command as sudo is:

sudo !!
This uses the powerful "History substitution" feature of tcsh. For more history substitution tricks: "man tcsh" and type "/History"

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020612020636217