A very nice tip is the command sudo !!
where it runs the latest command but with sudo. So for example, let’s say that you try to see a file where you do not have access.
cat myfile.txt
Permission denied
Then, we can run:
sudo !!
Which is equivalent to:
sudo cat myfile.txt