Skip to content

Commit a46ad28

Browse files
authored
Document commands for diagnosing macOS restarts
Added commands to investigate unexpected system restarts on macOS.
1 parent 904b1ff commit a46ad28

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

_articles/macos.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,35 @@ title: macOS
88
On my Varmilo keyboard:
99

1010
- **Win + Alt + Fn + F5** shows the Accessibility Shortcuts menu - useful for enabling Full Keyboard Access when connecting a Bluetooth mouse
11+
12+
## Unexpected restarts
13+
14+
Some useful commands to investigate why your system restarted:
15+
16+
```sh
17+
# Recent reboot history
18+
last reboot | head -10
19+
20+
# Last boot time
21+
who -b
22+
23+
# Power management log — sleep/wake/shutdown events
24+
pmset -g log | grep -E "(Sleep|Wake|Shutdown|Restart|Panic|reboot)" | tail -20
25+
26+
# Shutdown cause codes and kernel panics
27+
pmset -g log | grep -E "(Shutdown Cause|shutdown cause|kernel panic)" | tail -10
28+
29+
# System log search for shutdown/restart/panic events (adjust --last as needed)
30+
log show --last 24h --predicate 'eventMessage contains "shutdown" OR eventMessage contains "restart" OR eventMessage contains "panic"' --style syslog | tail -30
31+
32+
# Recent crash/diagnostic reports (kernel panics, watchdog resets, etc.)
33+
ls -lt ~/Library/Logs/DiagnosticReports/ | head -10
34+
ls -lt /Library/Logs/DiagnosticReports/ | head -10
35+
36+
# Software update history
37+
softwareupdate --history
38+
39+
# Recent software install history (all apps)
40+
system_profiler SPInstallHistoryDataType | grep -B2 -A3 "Date:"
41+
```
42+

0 commit comments

Comments
 (0)