20230112在Ubuntu下看笔记本电脑电池的电量

2023-05-16

20230112在Ubuntu下看笔记本电脑电池的电量
2023/1/12 17:24

ubuntu20.04

Xshell 7 (Build 0108)
Copyright (c) 2020 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.
[C:\~]$ 

Connecting to 192.168.186.228:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.8.0-48-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

415 updates can be applied immediately.
311 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update
New release '22.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Your Hardware Enablement Stack (HWE) is supported until April 2025.
Last login: Thu Jan 12 17:19:28 2023 from 192.168.186.224
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ 
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ upower --dump | grep --color=never -E "state|to\ full|to\ empty|percentage"
    state:               discharging
    time to empty:       38.0 minutes
    percentage:          21%
    state:               discharging
    time to empty:       38.0 minutes
    percentage:          21%
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ 
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ upower -i /org/freedestkop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ 
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ upower -i /org/freedestkop/UPower/devices/battery_BAT0
  native-path:          (null)
  power supply:         no
  updated:              1970年01月01日 星期四 08时00分00秒 (1673515235 seconds ago)
  has history:          no
  has statistics:       no
  unknown
    warning-level:       unknown
    battery-level:       unknown
    icon-name:          '(null)'

rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ 
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ upower --dump | grep --color=never -E "state|to\ full|to\ empty|percentage"
    state:               discharging
    time to empty:       35.5 minutes
    percentage:          20%
    state:               discharging
    time to empty:       35.5 minutes
    percentage:          20%
rootroot@rootroot-HP-ZHAN-66-Pro-A-14-G3:~$ 
 

 

ubuntu22.04

Xshell 7 (Build 0108)
Copyright (c) 2020 NetSarang Computer, Inc. All rights reserved.

Type `help' to learn how to use Xshell prompt.
[C:\~]$ 

Connecting to 192.168.186.227:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-57-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

131 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

Last login: Thu Jan 12 14:09:23 2023 from 192.168.186.224
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ sudo apt-get install acpi
[sudo] password for rootroot: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  acpi
0 upgraded, 1 newly installed, 0 to remove and 160 not upgraded.
Need to get 13.0 kB of archives.
After this operation, 53.2 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu jammy/universe amd64 acpi amd64 1.7-1.1ubuntu1 [13.0 kB]
Fetched 13.0 kB in 1s (20.7 kB/s)
Selecting previously unselected package acpi.
(Reading database ... 223284 files and directories currently installed.)
Preparing to unpack .../acpi_1.7-1.1ubuntu1_amd64.deb ...
Unpacking acpi (1.7-1.1ubuntu1) ...
Setting up acpi (1.7-1.1ubuntu1) ...
Processing triggers for man-db (2.10.2-1) ...
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ acpi -i
Battery 0: Not charging, 100%
Battery 0: design capacity 3549 mAh, last full capacity 3231 mAh = 91%
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ acpi -i
Battery 0: Not charging, 100%
Battery 0: design capacity 3549 mAh, last full capacity 3231 mAh = 91%
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ upower -i /org/freedestkop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
    percentage:          0% (should be ignored)
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ upower -i /org/freedestkop/UPower/devices/battery_BAT0 
  native-path:          (null)
  power supply:         no
  updated:              1970年01月01日 星期四 08时00分00秒 (1673514445 seconds ago)
  has history:          no
  has statistics:       no
  unknown
    warning-level:       unknown
    battery-level:       unknown
    percentage:          0% (should be ignored)
    icon-name:          '(null)'

rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
rootroot@rootroot-adol-ADOLBOOK-I421UAY-ADOL14UA:~$ 
 

 


参考资料:
https://blog.51cto.com/u_13733787/5767749
ubuntu linux终端下查看电池状态


https://developer.aliyun.com/article/1040701
查看ubuntu 下 电池电量的2种方法
 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

20230112在Ubuntu下看笔记本电脑电池的电量 的相关文章

  • 升级到Python 3.6后启动时无法启动cloud-init

    我在新的云服务器 Ubuntu 16 04 上安装了 Python 3 6 而不是默认的 3 5 版本 我重启服务器后发现执行失败cloud init启动时出现以下错误syslog Sep 20 16 16 14 cloud init 13
  • 在 Ubuntu 上运行独立的 ASP.NET Core 应用程序

    我已经发布了一个 ASP NET Core 应用程序作为针对 Ubuntu 的独立应用程序 发布似乎工作正常 我已将这些文件复制到一台漂亮的 Ubuntu 机器上 现在 我如何运行我的应用程序 我的理解是 因为它是一个独立的 NET Cor
  • vagrant + virtualbox 等待机器启动时超时

    抱歉 我对 vagrant 很陌生 我正在运行 vagrant 1 4 3 和 virtualbox 4 3 26 我的主机操作系统是 ubuntu 14 04 2 我是一名 php 开发人员 我正在努力让我的开发环境为几个项目做好准备 我
  • 使用mongodb+srv配置Mongo

    我在 docker 上启动 mongo 所以默认主机 localhost port 27017 用户名 root密码 example 现在我想通过连接字符串进行连接 mongodb srv root example localhost si
  • http://localhost:50070/ 的 hadoop Web UI 不起作用

    命令 jps 显示以下详细信息 第5144章 5464 节点管理器 5307 资源管理器 5800 Jps 显然namenode和datanode丢失了 网络用户界面位于http 本地主机 50070 http localhost 5007
  • 当我尝试在 ubuntu:18.04 中移动 /etc/resolv.conf 时,出现“设备或资源繁忙”。怎么解决呢?

    我的 Docker 容器中有一个 VPN 客户端 ubuntu 18 04 客户必须执行以下操作 mv etc resolv conf etc resolv conf orig 然后客户端应该创建新的 etc resolv conf与他们的
  • EDITLogBack Syslog 不工作 java

    我写了一个简单的项目来在 Ubuntu 中运行日志 方法如下example https examples javacodegeeks com enterprise java logback logback syslog example 应用
  • apt-get install tzdata 非交互式

    当我尝试 apt get install y tzdata 将显示用于选择时区的命令行选项 我试图在脚本中使用它来进行一些设置 如何在没有用户输入的情况下使 apt get 运行 我知道重新配置 tzdata 我可以做 echo Ameri
  • 给出 5 个参数,但在终端中只得到 3 个参数

    我想将一个文件传递给一个c 程序 如果我在 IDE 中执行此操作 test string string lt test txt return argc 5 但在终端上我刚刚得到argc 3 看来 这是因为 什么是 lt 意思是 我正在使用
  • Jenkins中找不到环境变量

    我想在詹金斯中设置很多变量 我试过把它们放进去 bashrc bash profile and profile of the jenkins用户 但 Jenkins 在构建发生时找不到它们 唯一有效的方法是将所有环境变量放入Jenkinsf
  • 在 Ubuntu 中使用 Gstreamer 通过 RTP 协议流式传输 Mp4 视频

    我正在尝试从本地目录获取视频文件 启用来自服务器的流并从客户端捕获这些帧 我使用了以下管道 服务器端 gst launch v filesrc location home gokul Videos Econ TestVideo radioa
  • Android 存储库初始化失败

    我想我非常仔细地遵循该网站的说明 http source android com source downloading html http source android com source downloading html 但是当我尝试这
  • 交叉编译armv5,但它创建v7二进制文件

    我设法为arm926ej s创建了一个目标文件我在 qemu 上使用 Debian Arm arm linux gnueabi gcc 4 4 static O c mcpu arm926ej s hello c o hello root
  • 如何在apache 2.4.6上安装apxs模块

    我刚刚用过apt get update我的 apache 已更新为2 4 6 我想安装 apxs 来编译模块 但收到此错误 The following packages have unmet dependencies apache2 pre
  • ubuntu 16.04.1 LTS 启动 Android 模拟器时崩溃

    我已经尝试过 Android studio 上的 AVD 和 Genymotion 模拟器 我的 ubuntu 16 04 1 在启动 android 模拟器时崩溃 冻结 我的电脑内存是16G 在我于 2016 年 9 月 19 日安装了
  • Ubuntu 12.10 libgtk-3-0 缺少符号

    我正在运行 Ubuntu 12 10 不知何故我的 libgtk 3 0 搞砸了 当尝试运行许多不同的应用程序时 我收到如下错误 gedit symbol lookup error usr lib libgtk 3 so 0 undefin
  • 没有名为“PIL”的模块

    当我尝试时遇到错误 from PIL import Image ImageFilter 在 Python 文件中我收到一条错误消息ModuleNotFoundError No module named PIL 到目前为止 我已经尝试卸载 重
  • 如何通过ssh检查ubuntu服务器上是否存在php和apache

    如何通过ssh检查Ubuntu服务器上apache是 否安装了php和mysql 另外如果安装的话在哪个目录 如果安装了其他软件包 例如 lighttpd 那么它在哪里 确定程序是否已安装的另一种方法是使用which命令 它将显示您正在搜索
  • 在初始化脚本中切换用户?

    这是我的 Ubuntu 工作站上的初始化脚本 我需要以除 root 之外的其他用户身份运行命令 但我就是不知道应该如何完成它 两者都不sudo u or su newuser似乎有效 剧本 respawn console none star
  • Ubuntu 上的 Python 2.7

    我是 Python 新手 正在 Linux 机器 Ubuntu 10 10 上工作 它正在运行 python 2 6 但我想运行 2 7 因为它有我想使用的功能 有人敦促我不要安装 2 7 并将其设置为我的默认 python 我的问题是 如

随机推荐