# Before doing anything, save your current configuration using
pmset -g
# To disable sleep 彻底禁用
sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1;# And to go back to normal 还原
sudo pmset -a sleep 1; sudo pmset -a hibernatemode [original hibernatemode value]; sudo pmset -a disablesleep 0;