# Disable sleep on Mac from the command line temporarily:
caffeinate
# Run for 4 hours:
caffeinate -t 144000 &
# Attach to other commands to prevent Mac from sleeping:
caffeinate [command_to_run] -arguments
# Disable sleep on Mac from the command line temporarily:
caffeinate
# Run for 4 hours:
caffeinate -t 144000 &
# Attach to other commands to prevent Mac from sleeping:
caffeinate [command_to_run] -arguments