How to execute the last command with Sudo

30 May 2019

If you forgot to add sudo in your last command, you don’t need to type it completely. To execute ant last executed command by as super user:

sudo !!

Also The double exclamation point will repeat the last command. This cold be usefull when you’ve already executed a very long command and don’t wanna re-type it again.

Tags: cli