If you are downloading a large file or rendering a video, your Mac going to sleep will interrupt the process. While you could change your system settings, there is a built-in terminal command that prevents sleep temporarily.
Using the Caffeinate Command
- Open the Terminal app on your Mac.
- Type the word
caffeinateand press Enter. - Your Mac will now stay awake indefinitely as long as the terminal window remains open.
- To stop it and allow your Mac to sleep normally, press Ctrl + C in the terminal window.