Prevent Mac from Sleeping
with menu bar App
There is an tiny app Caffeine that puts an icon in the menu bar.
Click it to prevent Mac from automatically going to sleep.
You can install it with brew cask
brew cask install caffeine
with a Terminal Command
Open Terminal application or iTerm2:
caffeinate -t 3600
Now your mac will not going to sleep, unless you disable it by pressing
Control + C.