Is there any Linux terminal command to query if the CMOS battery is working?
There is no direct Linux terminal command that explicitly outputs the CMOS battery status as a voltage level or detailed measurement. However, Linux provides a basic go/no-go indicator of the CMOS battery status through the realtime clock (RTC) interface.
You can check the CMOS battery status by running:
cat /proc/driver/rtc | grep batt_status
- This command shows a
batt_status
field which will displayokay
if the CMOS battery is in acceptable condition. - If the battery is dead or failing, it typically shows
dead
. - This indicator is based on whether the RTC time and date seem reasonable rather than an actual voltage measurement, so it acts as a rough health check rather than a precise reading.
For a more detailed voltage measurement, specialized hardware monitoring tools like lm-sensors
might detect the battery voltage if the sensor is supported and labeled (e.g., Vbat
), but this is uncommon and motherboard-specific.
In summary, the simplest method to check CMOS battery health under Linux is:
cat /proc/driver/rtc | grep batt_status
— showing “okay” means the battery is working; otherwise, it may need replacement.[1][5][8]