I try to get previous shutdown cause and when it happened but i don't know correct syntax.

syslog -k Sender kernel ???

I need to get date and time in start of the row and shutdown cause number in end of the row which can be negative number too.


I usually just run

sudo grep "Previous shutdown cause" /var/log/system.log

or (if the above returns empty)

sudo zgrep "Previous shutdown cause" /var/log/system.log.*.gz
| improve this answer | |
  • syslog should be system.log on my Mac. – Gilby Nov 9 '15 at 9:35

In Sierra, use log:

log show --predicate 'eventMessage CONTAINS "shutdown cause"'
| improve this answer | |

You can run Console.app (e.g. from Launchpad) and in All messages and type shutdown cause in Search box, this will list all codes in a row.

After selecting multiple rows, they can be copied into the clipboard.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .