Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the sysfs file system to view notebook battery status in linux

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use the sysfs file system in linux to check the battery status of the notebook, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

How to use the sysfs file system to view the battery status of a laptop

The sysfs file system is a pseudo file system that provides kernel data structure interfaces. The files under sysfs provide information about devices, kernel modules, file systems, and other kernel components.

The sysfs file system is usually mounted at / sys. In general, it is automatically mounted by the system, but it can also be mounted manually using commands such as mount-t sysfs sysfs / sys.

Many files in the sysfs file system are read-only, but some are writable, allowing kernel variables to be changed. To avoid redundancy, symbolic links are widely used to connect entries in the number of file systems.

$cat / sys/class/power_supply/BAT0/*051Normal0cat: / sys/class/power_supply/BAT0/device: Is a directory522600006000000026660000SMPL14M4P23cat: / sys/class/power_supply/BAT0/power: Is a directory276560001 756Chargingcat: / sys/class/power_supply/BAT0/subsystem: Is a directoryLi-ionBatteryPOWER_SUPPLY_NAME=BAT0POWER_SUPPLY_STATUS=ChargingPOWER_SUPPLY_PRESENT=1POWER_SUPPLY_TECHNOLOGY=Li-ionPOWER_SUPPLY_CYCLE_COUNT=0POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000POWER_SUPPLY_VOLTAGE_NOW=15840000POWER_SUPPLY_POWER_NOW=27656000POWER_SUPPLY_ENERGY What are the versions of FULL_DESIGN=60000000POWER_SUPPLY_ENERGY_FULL=52260000POWER_SUPPLY_ENERGY_NOW=26660000POWER_SUPPLY_CAPACITY=51POWER_SUPPLY_CAPACITY_LEVEL=NormalPOWER_SUPPLY_MODEL_NAME=L14M4P23POWER_SUPPLY_MANUFACTURER=SMPPOWER_SUPPLY_SERIAL_NUMBER= 7561480000015840000Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

Thank you for reading this article carefully. I hope the article "how to use the sysfs file system to check notebook battery status in linux" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report