14

Since I am not an American, the following command outputs for example `55000' which means 55°C.

cat /sys/class/thermal/thermal_zone1/temp

Does this command output the temperature in Fahrenheit for computers which are configured US.EN?

3 Answers 3

18

According to the kernel documentation, lines 221ff, the unit is "millidegree Celsius". Since this is hard wired into the kernel, I don't think that you can change the unit to fahrenheit by changing the system locale.

11

Dassman's answer is correct.
The cat command simply prints the contents of a file, which in this case is located on the /sys filesystem.

The /sys is actually provided by the kernel
all files in /sys are actually parts of the kernel, echoing certain commands into specific modules allows you to control functions of the kernel (e.g. scanning for new SCSI/SATA devices, or even disabling CPU cores from being used by the kernel) .

It is not the kernels job to provide any form of localisation, that is done in usermode applications. so, the /sys FS would provide the "raw" value of 55000, it would be the job of an application running to read the value and do the relevant conversion.

7

No. This information comes from the hardware and isn't affected by your locale settings. The unit for temperature is C (or K, but those are the same degrees, just a different scale) in all scientific and technical uses, even in the US.

So no, you wouldn't see those temperatures in Fahrenheit even if your OS used a US locale.

You must log in to answer this question.

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