作者:吴台吉国瑋智仁 | 来源:互联网 | 2023-06-13 10:03
CentOs7中查看电量剩余电量查看CentOs7中电量剩余电量:catsysclasspower_supplyBAT0capacity [root@localhost~]#cat
CentOs7中查看电量剩余电量
- 查看CentOs7中电量剩余电量:cat /sys/class/power_supply/BAT0/capacity
[root@localhost ~]# cat /sys/class/power_supply/BAT0/capacity
100
[root@localhost ~]# ls /sys/class/power_supply/BAT0/
alarm device energy_now power serial_number technology voltage_min_design
capacity energy_full manufacturer power_now status type voltage_now
cycle_count energy_full_design model_name present subsystem uevent
[root@localhost ~]# cat /sys/class/power_supply/BAT0/power
cat: /sys/class/power_supply/BAT0/power: Is a directory
[root@localhost ~]# cat /sys/class/power_supply/BAT0/energy_full
45180000
[root@localhost ~]# cat /sys/class/power_supply/BAT0/capacity
100
[root@localhost ~]#