Caffeinate
I haven’t had much to write about this past month or so, but I wanted to document an Apple MacOS command that I recently learned about in case I need it again. MacOS ships with a CLI tool called caffeinate
. It’s a simple tool that you run from a terminal, and it keeps your laptop from going to sleep. This is useful if you have a background task running unattended and you don’t want your laptop going to sleep and interrupting the task. In my case, I was copying large files back and forth to cloud storage. It took several hours to complete the copies, and I didn’t want to sit there bumping my mouse every so often to keep the laptop from going to sleep and cancelling the copy task. When the copy job was finished, all I had to do was hit Ctrl-C
in the terminal window where caffeinate was running and my laptop resumed it’s normal sleep schedule. Not earth-shattering by any means, but I still thought it was kind of neat.