It can be useful to retrieve information about a Mac from the command line. For example, if you have booted into recovery mode or to an installer, or you have done a remote SSH session to another computer.
This command shows piles of stuff, but is slow: system_profiler
Shows lots of system paramaters, fast: sysctl -a
Show running OS version: sw_vers
Show OS version on disk: cat /Volumes/Macintosh\ HD/System/Library/CoreServices/SystemVersion.plist. Note: Assumes disk is called "Macintosh HD".
Show free space on volumes: df -H
Show model number only: system_profiler SPHardwareDataType | grep 'Model Identifier'
I usually write a blog post about once a week. The latest post can be viewed here: Deontology vs Consequentialism: If we have free speech, personal freedom, equality, and truthfulness we are off to a pretty good start. (posted 2025-10-20 at 17:08:06). Warning: mysqli_connect(): MySQL server has gone away in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 59
Warning: mysqli_connect(): Error while reading greeting packet. PID=83599 in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 59
Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 59
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /Library/WebServer/Documents/Owen2/Inc/Footer.inc.php on line 60
Could not connect to MySQL: