{"id":7873,"date":"2021-07-10T12:04:00","date_gmt":"2021-07-10T12:04:00","guid":{"rendered":"https:\/\/linuxways.net\/?p=7873"},"modified":"2021-07-10T12:04:00","modified_gmt":"2021-07-10T12:04:00","slug":"how-to-check-laptop-battery-status-on-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-check-laptop-battery-status-on-centos-8\/","title":{"rendered":"How to Check Laptop Battery Status on CentOS 8"},"content":{"rendered":"<p>This article is about different ways of checking laptop battery status on CentOS 8. CentOS 8 is a Linux distribution in which GUI users can check the battery status by pointing the mouse at the battery icon in the status bar. Whereas, the command-line users have to write commands to check the status of the battery. Although, it is not difficult to check battery status on Linux distributions. But, for most beginners, it can look like a demanding task.<\/p>\n<p>In this article, we are going to learn commands or methods to check battery status on a CentOS 8.<\/p>\n<p>There are different methods available to check battery status on CentOS 8.<\/p>\n<h2><strong>Check battery status using the Upower command<\/strong><\/h2>\n<p>You can use the Upower command to check the battery status. In most Linux distributions, this command is preinstalled. Open the terminal and execute the below-mentioned command:<\/p>\n<pre>\u00a0$ upower -i \/org\/freedesktop\/UPower\/devices\/battery_BAT0<\/pre>\n<p>The output of the above command does not only show battery status but also detailed information about the battery such as vendor name, voltage, serial number, etc.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1099\" height=\"653\" class=\"wp-image-7874\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-18.png 1099w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-18-300x178.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-18-1024x608.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-18-768x456.png 768w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<p>As visible from the above output, the battery charging of the system is 95%. This command also displays other information related to the battery.<\/p>\n<p>When you only want to see battery status without detailed information, use the Upower command in combination with the grep command as follows:<\/p>\n<pre>$ upower -i \/org\/freedesktop\/UPower\/devices\/battery_BAT0 | grep -i \"state\\|percentage\\|time to empty\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1194\" height=\"176\" class=\"wp-image-7875\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-19.png 1194w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-19-300x44.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-19-1024x151.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-19-768x113.png 768w\" sizes=\"auto, (max-width: 1194px) 100vw, 1194px\" \/><\/p>\n<p>The above output only shows the battery charging status. Battery charging is 99% in the above-displayed output at that time.<\/p>\n<p>For more details about the Upower command, visit the man pages.<\/p>\n<pre>$ man upower<\/pre>\n<h2><strong>Display Laptop battery status through Sysfs File system<\/strong><\/h2>\n<p>The \u2018Cat\u2019 and \u2018Find\u2019 commands are another easy method to check battery status using the sysfs file system.<\/p>\n<p>Using the sysfs file system, user can easily display the battery charging status by using the following command:<\/p>\n<pre>$ cat \/sys\/class\/power_supply\/BAT0\/capacity<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1099\" height=\"84\" class=\"wp-image-7876\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-20.png 1099w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-20-300x23.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-20-1024x78.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-20-768x59.png 768w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/p>\n<p>As visible from the above output, the battery level of our system is 100%. If you also want to see details of the power supply, you can use the \u2018Find\u2019 command. Run the following command on your terminal.<\/p>\n<pre>$ find \/sys\/class\/power_supply\/BAT0\/ -type f | xargs -tn1 cat<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1105\" height=\"648\" class=\"wp-image-7877\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-21.png 1105w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-21-300x176.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-21-1024x600.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-21-768x450.png 768w\" sizes=\"auto, (max-width: 1105px) 100vw, 1105px\" \/><\/p>\n<p>As evident from the above-given output, the\u201d Find\u201d command displays different details of the battery such as design, model name, manufacturer, etc.<\/p>\n<h2><strong>Check laptop battery status through GUI environment<\/strong><\/h2>\n<p>To check the laptop battery status, go into the system setting and choose the \u2018power\u2019 option from the left sidebar, which is shown in the following screenshot:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1196\" height=\"909\" class=\"wp-image-7878\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-22.png 1196w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-22-300x228.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-22-1024x778.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-22-768x584.png 768w\" sizes=\"auto, (max-width: 1196px) 100vw, 1196px\" \/><\/p>\n<p>In the above-displayed output, you can see the battery status of your laptop.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>We have discussed different methods in this article for checking the battery status on CentOS 8. All the above methods are useful and easy for beginners. After reading this article, I hope now you can easily check your laptop battery status on CentOS 8 distribution.<\/p>","protected":false},"excerpt":{"rendered":"<p>This article is about different ways of checking laptop battery status on CentOS 8. CentOS 8 is a Linux distribution in which GUI users can check the battery&hellip;<\/p>","protected":false},"author":1,"featured_media":8241,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,399],"class_list":["post-7873","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-8","tag-laptop-battery-status"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=7873"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7873\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/8241"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=7873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=7873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=7873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}