[TOC]

hwinfo 命令

描述:hwinfo 意即硬件信息工具,是另外一种很好的实用工具。它被用来检测系统中已存在的硬件,并且以可读的格式显示各种硬件组件的细节信息。
系统发行版安装hwinfo:

#示例1.Arch Linux
$ sudo pacman -S hwinfo

#示例2.Fedora
$ sudo dnf config-manager --add-repo http://download.opensuse.org/repositories/home:/zhonghuaren/Fedora_26/home:zhonghuaren.repo
$ sudo dnf makecache
$ sudo dnf install hwinfo

#示例3.centos
$ sudo rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el6.noarch.rpm
$ sudo rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
$ sudo yum makecache
$ sudo yum install hwinfo

#示例4.Debian/Ubuntu
$ sudo apt-get install hwinfo

#示例5.openSUSE
$ sudo zypper install hwinfo

hwinfo支持的检测的硬件设备:

CPU : manufacturer, model, frequency
Motherboard : manufacturer, model, BIOS version, on-board controller
RAM : RAM size, RAM type (FP, EDO, SDRAM, DDRAM)
Hard disk controller : SCSI, IDE, on-board/card, model, BIOS version, chipset
Hard disks : type, manufacturer, model, size, bus system (SCSI, IDE), partitioning
CD-ROM drives : type, manufacturer, model, speed, internal/external, parallel port?
Other media : CD writer, streamer (model, manufacturer, SCSI/EIDE/floppy streamer, capacity), ZIP drives, Jaz drives, MO drives,flopticals
Graphics card : model, manufacturer, chipset, memory (DRAM, VRAM), memory size
Other peripherals : printer, parallel ports, serial ports, modem, ISDN card

语法参数:

hwinfo [OPTIONS] [HARDWARE_ITEM]
#指定项查看
--<HARDWARE_ITEM>
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, mmc-ctrl, 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 #显示摘要信息

基础示例:

#示例1.获取网络信息
hwinfo --network
45: None c0.0: 10701 Ethernet
[Created at net.126]
Unique ID: c0d5.ndpeucax6V1
Parent ID: wMMD.PlGB53gtlv4
SysFS ID: /class/net/ens192
SysFS Device Link: /devices/pci0000:00/0000:00:16.0/0000:0b:00.0
Hardware Class: network interface
Model: "Ethernet network interface"
Driver: "vmxnet3"
Driver Modules: "vmxnet3"
Device File: ens192
HW Address: 00:50:56:b3:dc:b4
Permanent HW Address: 00:50:56:b3:dc:b4
Link detected: yes
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #44 (Ethernet controller)


#显示摘要信息
hwinfo --short
cpu: Intel(R) Xeon(R) CPU E3-1271 v3 @ 3.60GHz, 3591 MHz
keyboard: /dev/input/event1 AT Translated Set 2 keyboard
mouse:
/dev/input/mice VirtualPS/2 VMware VMMouse
/dev/input/mice VirtualPS/2 VMware VMMouse
graphics card: VMware VMWARE0405