Note to Self Mac Os Terminal Run Last Command

Note to self

Run last command

Simple shortcut that stands in place of your previously written command:

!!

Yup, that's it. This is useful after having typed a long command, we find out it needed root privileges. To enter the last command again but with sudo in front, we can just type:

sudo !!