Linux shell编程学习笔记54:hwinfo --cpu命令 显示cpu设备信息

0 前言

在Linux中,获取cpu信息的命令很多,除了我们已经研究的 cat /proc/cpuinfo、lscpu、nproc命令,还有hwinfo --cpu 命令。

1 安装 hwinfo 命令

hwinfo是外部命令,有些系统中没有安装。那么我们可以使用命令:

sudo apt install hwinfo

来进行安装。

[purpleendurer @ bash ~] hwinfo --cpu
程序“hwinfo”尚未安装。 您可以使用以下命令安装:
sudo apt install hwinfo
[purpleendurer @ bash ~] sudo apt install hwinfo
[sudo] purpleendurer 的密码:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
下列软件包是自动安装的并且现在不需要了:
  gnome-video-effects gstreamer1.0-clutter-3.0 libcheese-gtk25 libcheese8 libclutter-gst-3.0-0 libclutter-gtk-1.0-0 libcompfaceg1 libetpan17 libfreerdp-cache1.1 libfreerdp-client1.1 libfreerdp-codec1.1
  libfreerdp-common1.1.0 libfreerdp-core1.1 libfreerdp-crypto1.1 libfreerdp-gdi1.1 libfreerdp-locale1.1 libfreerdp-primitives1.1 libfreerdp-utils1.1 libgusb2 libnatpmp1 libpisock9 libssh-4 libudev-dev
  libvncclient1 libwinpr-crt0.1 libwinpr-dsparse0.1 libwinpr-environment0.1 libwinpr-file0.1 libwinpr-handle0.1 libwinpr-heap0.1 libwinpr-input0.1 libwinpr-interlocked0.1 libwinpr-library0.1 libwinpr-path0.1
  libwinpr-pool0.1 libwinpr-registry0.1 libwinpr-rpc0.1 libwinpr-sspi0.1 libwinpr-synch0.1 libwinpr-sysinfo0.1 libwinpr-thread0.1 libwinpr-utils0.1 libxcomp3 nxproxy remmina-common
使用'sudo apt autoremove'来卸载它(它们)。
将会同时安装下列软件:
  libhd21
下列【新】软件包将被安装:
  hwinfo libhd21
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 629 个软件包未被升级。
需要下载 578 kB 的归档。
解压缩后会消耗 2,588 kB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0/universe arm64 libhd21 arm64 21.23-1kord [560 kB]
获取:2 http://archive.kylinos.cn/kylin/KYLIN-ALL 10.0/universe arm64 hwinfo arm64 21.23-1kord [17.7 kB]
已下载 578 kB,耗时 0秒 (622 kB/s)
正在选中未选择的软件包 libhd21:arm64。
(正在读取数据库 ... 系统当前共安装有 228925 个文件和目录。)
正准备解包 .../libhd21_21.23-1kord_arm64.deb  ...
正在解包 libhd21:arm64 (21.23-1kord) ...
正在选中未选择的软件包 hwinfo。
正准备解包 .../hwinfo_21.23-1kord_arm64.deb  ...
正在解包 hwinfo (21.23-1kord) ...
正在处理用于 libc-bin (2.23-0kord11k20.5) 的触发器 ...
正在处理用于 man-db (2.7.5-1kord) 的触发器 ...
正在设置 libhd21:arm64 (21.23-1kord) ...
正在设置 hwinfo (21.23-1kord) ...
正在处理用于 libc-bin (2.23-0kord11k20.5) 的触发器 ...
[purpleendurer @ bash ~] type -a hwinfo
hwinfo 是 /usr/sbin/hwinfo

 安装过程:

 hwinfo是外部命令

2 hwinfo 命令的功能

hwinfo命令来自英文“Hardware Information”的缩写,它的功能是用于查询硬件信息。

我们可以指定不同的选项来查询不同的硬件信息。

[purpleendurer @ bash ~] hwinfo --help
Usage: hwinfo [OPTIONS]
Probe for hardware.
Options:
    --<HARDWARE_ITEM>
        This option can be given more than once. Probe for a particular
        HARDWARE_ITEM. Available hardware items are:
        all, arch, bios, block, bluetooth, braille, bridge, camera,
        cdrom, chipcard, cpu, disk, dsl, dvb, fingerprint, floppy,
        framebuffer, gfxcard, hub, ide, isapnp, isdn, joystick, keyboard,
        memory, modem, monitor, mouse, netcard, network, partition,
        pci, pcmcia, pcmcia-ctrl, pppoe, printer, redasd,
        reallyall, scanner, scsi, smp, sound, storage-ctrl, sys, tape,
        tv, uml, usb, usb-ctrl, vbe, wlan, xen, zip
    --short
        Show only a summary. Use this option in addition to a hardware
        probing option.
    --listmd
        Normally hwinfo does not report RAID devices. Add this option to
        see them.
    --only DEVNAME
        This option can be given more than once. If you add this option,
        only data about devices with DEVNAME will be shown.
    --save-config SPEC
        Store config  for a particular device below /var/lib/hardware.
        SPEC can be a device name, an UDI, or 'all'. This option must be
        given in addition to a hardware probing option.
    --show-config UDI
        Show saved config data for a particular device.
    --map
        If disk names have  changed (e.g. after a kernel update) this
        prints a list of disk name mappings. Note  that  you must have
        used --save-config at some point before for this can work.
    --debug N
        Set debug level to N. The debug info is shown only in the log
        file. If you specify a log file, the debug level is implicitly
        set to a reasonable value.
    --verbose
        Increase verbosity. Only together with --map.
    --log FILE
        Write log info to FILE.
    --dump-db N
        Dump hardware data base. N is either 0 for the external data
        base in /var/lib/hardware, or 1 for the internal data base.
    --version
        Print libhd version.
    --help
        Print usage.
[purpleendurer @ bash ~] 

 

 hwinfo命令可以查询的硬件信息包括:

设备项说明
all以下所有信息
arch系统架构信息
biosBIOS 信息
block
bluetooth蓝牙信息
braille
bridge
camera摄像头信息
cdrom光驱信息
chipcard芯片信息
cpuCPU信息
disk磁盘信息
dsl
dvb
fingerprint
floppy软驱信息
framebuffer
gfxcard
hub总线信息
ideIDE设备信息
isapnp
isdn
joystick
keyboard键盘信息
memory内存信息
modem调制解调器信息
monitor显示器信息
mouse鼠标信息
netcard网卡信息
network网络信息
partition
pciPCI设备信息
pcmcia
pcmcia-ctrl
pppoe
printer打印机信息
redasd
reallyall
scanner扫描仪信息
scsiscsi设备信息
smp
sound
storage储存器信息
storage-ctrl储存控制器信息
sys
tape
tv
uml
usbUSB设备信息
usb-ctrlUSB控制器信息
vbe
wlanWLAN信息
xen
zip

3 hwinfo --cpu 命令的功能

如果我们在使用hwinfo命令时指定--cpu 选项,就可以查询cpu设备信息。

4 hwinfo --cpu 命令显示的信息

[purpleendurer @ bash ~] hwinfo --cpu
01: None 00.0: 10103 CPU                                        
  [Created at cpu.338]
  Unique ID: rdCR.j8NaKXDZtZ6
  Hardware Class: cpu
  Arch: AArch64
  Vendor: "unknown (70)"
  Model: 1.3.0 ""
  Features: fp,asimd,evtstrm,aes,pmull,sha1,sha2,crc32
  Config Status: cfg=new, avail=yes, need=no, active=unknown

02: None 00.0: 10103 CPU
  [Created at cpu.338]
  Unique ID: rdCR.j8NaKXDZtZ6
  Hardware Class: cpu
  Arch: AArch64
  Vendor: "unknown (70)"
  Model: 1.3.0 ""
  Features: fp,asimd,evtstrm,aes,pmull,sha1,sha2,crc32
  Config Status: cfg=new, avail=yes, need=no, active=unknown

03: None 00.0: 10103 CPU
  [Created at cpu.338]
  Unique ID: rdCR.j8NaKXDZtZ6
  Hardware Class: cpu
  Arch: AArch64
  Vendor: "unknown (70)"
  Model: 1.3.0 ""
  Features: fp,asimd,evtstrm,aes,pmull,sha1,sha2,crc32
  Config Status: cfg=new, avail=yes, need=no, active=unknown

04: None 00.0: 10103 CPU
  [Created at cpu.338]
  Unique ID: rdCR.j8NaKXDZtZ6
  Hardware Class: cpu
  Arch: AArch64
  Vendor: "unknown (70)"
  Model: 1.3.0 ""
  Features: fp,asimd,evtstrm,aes,pmull,sha1,sha2,crc32
  Config Status: cfg=new, avail=yes, need=no, active=unknown

 返回信息说明

返回信息说明
Unique ID: rdCR.j8NaKXDZtZ6唯一ID
Hardware Class: cpu硬件类别
Arch: AArch64架构
Vendor: "unknown (70)"供应商
Model: 1.3.0 ""型号
Features: fp,asimd,evtstrm,aes,pmull,sha1,sha2,crc32特性
Config Status: cfg=new, avail=yes, need=no, active=unknown配置状态
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

紫郢剑侠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值