Keep Mac Awake & Disable Sleeping

GOAL: Keep MacBook awake no matter what, disabling any setting which may make it fall asleep. This can be helpful when transferring data that can take hours.  This Caffeniate command is built in to all Macs, so nothing extra needs downloaded for this to work.

STEPS:

1.  Open Terminal & type the following:

caffeinate -disu

    • -d: Prevents display from going to sleep.
    • -i: Prevents system from idle sleeping (sleep that occurs after a period of inactivity configured in Mac > Settings > Battery, or Energy Saver).
    • -s: Prevents the system from sleeping while on AC power (only applies when not using battery power or if the laptop lid is closed).
    • -u: Updates the user activity timestamp. This is a general assertion that the system is in use, which also helps in preventing sleep. 
2.  As long as that Terminal session stays open, your MacBook will stay awake without any form of sleeping. 

3. To end the session and allow your Mac to sleep again, type the following:

control + C