When this question was asked in 2012, specifically mentioning the "command line" requirement, an answer suggested Temperature Monitor (a "legacy" product). Running all three, Temperature Monitor along with smcFanControl and iStat Menu, side-by-side shows the problem. I don't want this level of perpetual distraction.
I suspect the following answer: It is not possible to see the CPU&GPU temperatures from the command line. I suspect this because both iStat and Temperature Monitor
install additional drivers. If that's the case, it would be nice to record that answer.
smcFanControl and iStat Menu are nice utilities to make you keep an eye on the temperature of your CPU. The former shows only the CPU temperature, and both are too distracting (the latter's precursor, iStat Nano, could sit silently in the Dashboard until one needed it, plus iStat Menu seems rather sticky: I haven't figured out how to delete it yet—just removing the program from /Applications
is insufficient.)
It was nice to find that ioreg will reveal the Maximum Capacity of a battery (in contrast to the static Design Capacity, the Maximum Capacity signals the health of the battery). Using a program (such as CoconutBattery) is not necessary.
A script (still using ioreg) will reveal the battery temperature
AppleSmartBattery Temperature: 30 °C 62.0 °F
and so I'm hoping for a renewed answer in 2017 to the following question.
How can I view the CPU temperature from the command line? It would especially be nice to also see the GPU temperature. OS X just crashed and rebooted on its own, and the Console logs ("Event: GPU Reset" and "GPU HangState 0x00000000") suggest that the GPU might be the culprit. I'm trying to determine if it's time to reapply the thermal paste and reattach the heatsinks (never done this before; not even sure it's within my ability).