You made a typo on your command or you got the error XXX : Permisson denied.

How will you repeat your last command?

If you are a Vim user like me — h, j, k, l is the way and hands should be always on the home row, or just don’t want to use default arrow key to get last command, there is an useful command to execute your last command; just type:

$ !!

then press CR | Enter.

In order to execute your previous command with sudo privilege just run

$ sudo !!

All done!