Shortcut to run previous shell command as superuser
Old Procedure
- Most of the time when we execute a permission required command but we forget to add
sudo
at the start of the command then terminal throws the error permission denied - So what we will do enter up arrow (navigation key) and enter home or continuously press left arrow key to go to the initial position of the previously executed command
- In command at the start position we will start type
sudo
- Instead of that we have an alternative to avoid navigating towards start of your command
New Procedure
- Now we are going to see how to execute the permission denied command alternative and fast way
- In your terminal type
sudo !!
- In terminal, you will see previously failed command is executing with superuser permission