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)%"
Share on FacebookTweet about this on TwitterShare on Google+Share on StumbleUponShare on RedditShare on TumblrShare on LinkedInEmail this to someone