I’ve lost count how many times I’ve forgot to ‘sudo’ something:
$ cp ../default.conf new.conf cp: new.conf: Permission denied
Instead of re-typing this or using the up arrow and prefixing sudo, you can do:
$ sudo !!
This will re-run the previous command as sudo. In my example above:
$ sudo !! sudo cp ../default.conf new.conf
A handy little time-saver!




