John Sanchez
John Sanchez

Categories

  • snippets

Tags

  • Mac
  • terminal

One day, you’ll want to keep your Mac up with you. Give it some caffeine with the “caffeinate” command.

What’s “caffeinate” do?

Open up Terminal or iTerm 2 and check out the man pages:

man caffeinate

How would I use it?

Just type in:

caffeinate

and your Mac will stay awake until you press Control + C to stop the command.

If you’d like, a timer to automatically shut it off is available.

caffeinate -u -t 120

Remember the “120” above is in seconds. In the above example, it would stay up for two minutes.