This is my small collection of OSX tips and tricks. Generally they are things that I’ve found useful, but which I can never remember.
Flushing the DNS Cache
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
KTrace / Strace equivilent
sudo ktrace trace -S -f C3,C4 -s -c <command>
Finding last Wireless AP and SSID mac connected to:
log show --predicate '(processImagePath contains "configd") && (eventMessage contains "en0: SSID ")' --style syslog --last 1d
See what is keeping MacOS awake. Also HID / Keyboards
pmset -g assertions
See what files a process is using / accessing:
sudo fs_usage pid <pid>
A less awful way of looking at logs:
log stream --predicate 'process contains "kernel"' --debug --info --style compact