Archive for December, 2011

sudo !!

December 25, 2011 Leave a comment

If you ran a unix command and then realized you should have run it as a superuser, you can run the following command out to execute your last command as sudo:

sudo !!

If you ran 

/usr/sbin/useradd myNewUser

but got a permission error:  

-bash: /usr/sbin/useradd: Permission denied

You can run sudo !! and the shell will actually run

sudo /usr/sbin/useradd myNewUser


Categories: Uncategorized