#Power & Sleep
35 solutions
caffeinate holds sleep off while a command runs, or for a fixed number of seconds.
pmset -g batt shows charge state; system_profiler SPPowerDataType adds condition and cycle count.
Use systemctl suspend for sleep-to-RAM and systemctl hibernate for sleep-to-disk, plus hybrid-sleep and suspend-then-hibernate variants.
Restore the missing Hibernate option and the hiberfil.sys file it depends on, from an admin prompt.
Use shutdown /s /t to make Windows power off automatically after a chosen number of seconds, and shutdown /a to cancel it.
Disable adapter power management so Wi-Fi doesn't disconnect every time the PC sleeps.
Install and enable TLP so Linux automatically applies power-saving settings for battery operation; check results with tlp-stat.
Read the current battery percentage, charging status and estimated remaining runtime in PowerShell with Win32_Battery.
Disable or re-enable Windows Fast Startup (hybrid boot) with the HiberbootEnabled registry value to fix shutdown and dual-boot problems.
Reboot or power off macOS with the built-in shutdown command — handy when the menu bar or remote session misbehaves.
pmset -g custom prints the live sleep configuration separately for battery and charger.
pmset includes two one-shot commands: displaysleepnow blanks the screen, sleepnow puts the whole Mac to sleep.