Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently I installed lm-sensor for monitoring my CPU temperature. I am monitoring it by this command in the terminal:

while [ true ]; do sensors; sleep 1; done

But I need to access my temperature after I run some stress test on the CPU to analysis some data. Is there a command that can write my temperature into a file during my stress test?

share|improve this question
up vote 1 down vote accepted

You can redirect the output of the sensors command to a file using the >> operator of the shell:

while [true]
   do
   sensors >> */your/file/here*
   sleep 1
done

The >> operator redirects standard output of a command to a file so in this case it will write the output of sensors to the file you name. One second is pretty frequent, so you'll want to make sure you don't leave this process running.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .