Source

bin / cput

#!/bin/bash
# Get temperature for CPU, MOBO, GPU, HDD

echo -e 'DATE\tCPU\tMOBO\tGPU\tHDD'

while (true) do

    DATE=`date '+%Y-%m-%d %H:%M:%S'`
    CPU=`sensors|egrep 'CPU Temperature'|awk '{print $3}'| sed 's/°C//'|sed 's/+//'`
    MOBO=`sensors|egrep 'MB Temperature'|awk '{print $3}'| sed 's/°C//'|sed 's/+//'`
    GPU=`nvidia-settings -q GPUCoreTemp | egrep 'Attribute'|awk '{print $4}'|sed 's/\.//'`
    HDD=`hddtemp /dev/sda | awk '{print $4}' | sed 's/°C//'`

    echo -e "$DATE\t$CPU\t$MOBO\t$GPU\t$HDD"

    sleep 5

done