Skip to content

Alex Ballas

Blog about anything :)

  • Home
  • Contact
  • Categories
    • Linux
    • General
    • Chilling Out
  • My PGP Public Key
  • Linkedin
  • Twitter

Tag: battery

Getting the remaining battery life with terminal

To get the remaining battery life with terminal, run the following command:

$ echo "$(echo "scale=4; `cat /proc/acpi/battery/BAT*/state  | grep remaining | awk  '{print $3}'`/`cat /proc/acpi/battery/BAT*/info  | grep "last full" | awk '{print  $4}'`* 100" | bc | cut -c-5)%"
Posted on December 31, 2010June 17, 2013Categories LinuxTags acpi, battery, linuxLeave a comment on Getting the remaining battery life with terminal
Proudly powered by WordPress