Go to advanced search

by saikiran91
Sat Jul 04, 2020 1:34 pm
Forum: Ubuntu
Topic: [ubuntu] Getting CPU tempature on Ubuntu
Replies: 13
Views: 12250

Re: [ubuntu] Getting CPU tempature on Ubuntu

For those who feel like compiling something, create file temp.c with the following: #include <stdio.h> int main(int argc, char *argv[]) { FILE *fp; int temp = 0; fp = fopen("/sys/class/thermal/thermal_zone0/temp", "r"); fscanf(fp, "%d", &temp); printf(">> CPU Temp: %.2f°C\n", temp / 1000.0); fclose...

Go to advanced search