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
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.
Here is bonus !!!
Source – AskUbuntu