Most computers (and OSes) will automatically go into sleep mode when it has been idle for some time. This can be useful in reducing power consumption and extending the life span of your hardware. However, it can be frustrating when the computer goes to sleep while you are watching a movie, or just listen to songs.

In Mac, there are several apps that you can install to prevent the system from “sleeping”, however, these apps are mostly unnecessary because you can easily do so with this command.

Open the terminal and type:

This command will prevent your Mac from sleeping. To stop it, simply press “Ctrl + c” to terminate it.

Note: This is only a quick example of what caffeinate can do. You can also append -d, -i, -s,-u, or -t flag for more advanced option.

Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.

Our latest tutorials delivered straight to your inbox