I don’t remember when I found this out, but when I did, it changed my life.
Ever get one of these?

wrobson$ mkdir /var/test
mkdir: /var/test: Permission denied

Permission denied? I’m pretty sure I have permission. Now follow that up with one of these.

wrobson$ sudo !!
sudo mkdir /var/test
Password:

The !!(bang bang) is repeating the last command entered.
Now we have the sudo in the front and its asking for our password and completing without error.