Home > Unix/Linux > Simple Trick To Run Last Command As Sudo

Simple Trick To Run Last Command As Sudo

You can often forget what you are not running as a super user, so if you type in a command that you can’t run with your current set of privileges it will tell give you a permission denied response.

An alternative is to use the !! command to run the last command in the .bash_history. Use this with the sudo command to run the last command as a super user.

> command
Permission denied
 
> sudo !!

Information, services, and products:
have a look at what we offer on our Supercar Membership
Categories: Unix/Linux Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.