How to run the last command as Sudo in Linux

This post was originally published on this site

A quick post as I always forget this command, learn how to run the last command again as sudo, to elevate and bypass permissions denied error.

## First command fails with permissions issue

dean@veducate # mv openshift-install /usr/local/bin/openshift-install
mv: cannot move 'openshift-install' to '/usr/local/bin/openshift-install': Permission denied

## Using the command "sudo !!" will run the last command with sudo, the full command will be outputed

dean@veducate # sudo !!
sudo mv openshift-install /usr/local/bin/openshift-install

## The terminal will return, including any necessary information as part of the command execution.

dean@veducate #

 

Regards

https://platform.twitter.com/widgets.js

Dean Lewis

The post How to run the last command as Sudo in Linux appeared first on vEducate.co.uk.