How to get the CPU temperature?

Getting the CPU temperature from command line can be achieved with:

printf '%d°\n' $(sensors | grep 'id 0:' | awk '{ print $4 }') 2>/dev/null
# 55°

printf '%d\n' Will convert the value to integer in case you need it as a round number
Other details and methods on getting the CPU temperature are explain on this QA

Share this post on:

Related posts:

How to detach a process from terminal's shell?
Using a different network interface for a specific application