Close ad

A few days ago, when I was with a friend who shoots videos and takes photos, we got into a situation where everything was already done and all we had to do was upload the materials to the Internet. All the files were several gigabytes in total, so we thought we'd let the files upload and go to town to see. However, when we arrived in the evening, we were sorry to discover that the file upload had stopped, due to the Mac going into sleep mode. It didn't work for me and I wanted to see if there was a simple way to set the Mac not to sleep.

Of course, you can set the time when the Mac goes into sleep mode in the system preferences. But this is too complicated and time-consuming, because after uploading the files to the Internet, you have to set this time back to a few minutes. Let's face it, most of us would definitely forget about it. But I found a handy command on the Internet, with which we can simply tell the Mac not to sleep. Let's see what this command looks like and how we can activate it.

The caffeinated command

The command that keeps your Mac from going to sleep is called "caffeinate" - so your Mac will drink an imaginary cup of coffee and stay awake until you tell it to.

To activate this command, we open Terminal. We will do so either in Spotlight, where Terminal is located in the folder jine or in the upper right corner we click on Lupu and write in the search box Terminal. After opening the Terminal, just enter this command:

caffeinated

The Mac immediately switches to caffeinated mode. From now on, it will not turn off by itself. In case you want to quit caffeinate, press the hotkey Control ⌃ + C.

We can also set this command for a certain time, ie. that it turns off after a certain elapsed time. For example, let's choose that we want the caffeinated mode to be active for only one hour. We have to change the clock for seconds, that is 3600 seconds and enter this command in the Terminal:

caffeinated -u -t 3600

After a certain amount of time, caffeinated mode will be interrupted and the Mac will be allowed to sleep. If you want to exit this mode earlier, just press the hotkey again Control ⌃ + C.

I hope this guide will help you, even in other activities than just uploading files. With this guide, you will never have to readjust the system preferences unnecessarily, and you will make your work and time easier. Just enter a simple command in the terminal and you don't have to worry about anything else.

caffeinated macos fb

Today's most read

.