How can I get the load average (and only the load average) on Mac OS X?
Solution 1:
You can also use this sysctl:
sysctl -n vm.loadavg
Solution 2:
Take the commands you know (top, uptime, w, etc.) and use other tools to reduce to just the data you want.
An example for w
:
w | head -n1 | cut -d":" -f4
An example for uptime
:
uptime | cut -d":" -f4- | sed s/,//g
An example of loads.d
:
sudo loads.d | awk '/./ { printf "%.2f %.2f %.2f\n", $7, $8, $9 }'