How to Run Last Terminal Command but as Root User (SUDO)

How to Run Last Terminal Command but as Root User (SUDO)

Its pretty common that Linux user often runs a command on terminal without SUDO (super user) which requires Super User (root user) permissions.But after login in as a super user with SUDO you need to retype the command (Cannot use upper arrow key to run last command).

There is a pretty interesting solution for this,Use

sudo !!

This will run the last type command even when you login as super user or root user.

For example,Here I am trying to delete a folder which requires root permission but didn’t execute with sudo.

Example

Example

Here is bonus !!!

terminal-command-xkcd

Source – AskUbuntu

Related tags to article

About author

No Comments

forum No comments yet

You can be first to leave a comment

Write a comment