PDA

View Full Version : Check Laptop Battery Status in Terminal!



Hitman
2013-04-28, 16:47
I usually work as a root in terminal without running x window system. This tool help me to check my laptop battery power statistics. Whereas in X window system (GNOME) you can easily check battery status in panel or by typing gnome-power-statistics command in terminal.

Install the ACPI tool first.

apt-get install acpi

Use the acpi command to display the status of your laptop battery

acpi

This command also has many other options. This one shows the CPU temperature.

acpi -t

And this one shows the status of the cooling in your machine.

acpi -c

For all information together type

acpi -V

and for help just type acpi --help

Hope it will increase you knowledge and please don't tell me about any other tools names as i know there are dozens of tools as well for this purpose like powertop but i like this its simple and accurate thanks.

Jano
2013-04-29, 09:40
Hi Hitman,
- You already have this information in /proc/acpi/battery:

cat /proc/acpi/battery/BAT1/info

cat /proc/acpi/battery/BAT1/state

NOTE:
- Change BAT1 parameter with your correct name usually BAT0

Bye Jano

Hitman
2013-04-29, 14:23
Hi Hitman,
- You already have this information in /proc/acpi/battery:

cat /proc/acpi/battery/BAT1/info

cat /proc/acpi/battery/BAT1/state

NOTE:
- Change BAT1 parameter with your correct name usually BAT0

Bye Jano

I don't think so it give No such file or directory :-)

wido046
2013-04-29, 21:28
i dont have no acpi package either the command cat /proc/acpi/battery
root@kali:/proc# ls
1 1619 2411 2869 2968 4378 6201 consoles misc
10 1620 2434 2872 2971 44 6202 cpuinfo modules
1015 167 2436 2883 2975 46 6203 crypto mounts
11 17 2438 2886 2976 4993 6227 devices mtrr
12 18 2441 2887 2987 5 6241 diskstats net
12991 19 2452 2893 2991 5066 6242 dma pagetypeinfo
13 196 2471 29 3 550 6250 dri partitions
13040 197 2472 2905 30 551 6313 driver sched_debug
13153 198 2473 2909 3006 5606 6316 execdomains self
13172 199 2474 2911 3012 5683 6317 fb slabinfo
14 2 2475 2912 3015 5787 6340 filesystems softirqs
14468 200 2476 2915 3019 5790 6405 fs stat
14630 201 2497 2917 3044 5791 6411 interrupts swaps
14652 21 2501 2920 31 5792 6412 iomem sys
14942 2188 251 2924 3177 5793 6433 ioports sysrq-trigger
15070 22 252 2929 3183 585 6508 irq sysvipc
15083 222 2591 2931 3184 587 7 kallsyms timer_list
15227 2265 26 2936 32 588 8 kcore timer_stats
15424 23 27 2949 33 593 9 keys tty
15435 2302 2720 2951 35 6044 9628 key-users uptime
15482 2328 2740 2957 36 608 acpi kmsg version
15496 2334 28 2960 37 6095 asound kpagecount vmallocinfo
15512 2353 2806 2961 38 6138 buddyinfo kpageflags vmstat
15670 24 2808 2962 39 619 bus loadavg zoneinfo
16 2406 2824 2963 396 6199 cgroups locks
160 2407 2868 2967 40 6200 cmdline meminfo
this is what it get kali amd64 thanks