OS X: disable sleep from the Terminal #

Especially handy when booted from an OS X install disc and running lengthy terminal commands like diskutil zeroDisk /dev/rdiskx:
$ caffeinate
That's it! Introduced in OS X 10.8, caffeinate can also timeout after x seconds with the -t switch, or stay active only for the duration of a given command (e.g., $ caffeinate diskutil zeroDisk /dev/rdiskx).

(Thanks to patrix for digging this up)

/mac | Nov 22, 2014


Subscribe or visit the archives.