Wednesday, November 23, 2011

Keeping it cool... tracking CPU temperatures on Debian GNU/Linux with a 3.1 kernel

My laptop is getting old (almost 12 months now), and is starting to see the first symptoms of age. Probably just dust piling up, but I have been experiencing CPU overheating. A week or too I found a nice one-liner to keep an eye on the CPU temperature, but a kernel upgrade to 3.1 broke that. Here is a script that works on my Linux laptop:

( cd /sys/class/thermal && while :; do line="`date`:`cat */temp | cut -c1-2 | awk '{ printf(\" %03d\", $1) }'`";   echo "$line";   sleep 5; done ) | tee LOG


  1. vacuum the keyboard
    our Dell was dying and this saved it.

  2. I guess you already tried air duster (can of compressed air) in the cpu cooling fan duct?

    (make sure the laptop is off when you sue it and also the heatsink is NOT hot as this air tends to cool things down quite rapidly)

  3. A can of compressed air can make miracles, highly recommended.

    You can get thermal info with acpi command as well. If you don't need log temperatures, you can simplify your one liner to: "watch acpi -t" :)

  4. The vacuum cleaner did a great job! Thanx for the encouragements and tips!

  5. Interesting little script, like the other comments, a bit of vacuuming has always done the trick for me. Being a programmer myself I was amused by the process - writing a script before anything else - it's so true! I think I'll give your one a go just to see what my CPU is up to, sparked my interest ;)

  6. You might have been hit by Linux power management regression, consider using "pcie_aspm=force" boot parameter for kernel.

    More details: