macOS – Tips and Commands

Commands

Shutdown reasoning

The command below will list details of any shutdown events logged within the last 24 hours, it includes the shutdown cause code. The main codes to look for are:

  • 5 – Correct shutdown
  • 3 – Hard shutdown (power button hold)
  • 0 – Powerloss ( battery empty or power cable disconnected)
  • -3 – Temperature related shutdown (multiple sensors have recorded temps outwith allowed limits)

log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h