lshw命令来自英文词组“list hardware”的缩写,其功能是用于查看硬件设备信息。lshw命令能够显示Linux系统中的内存配置、固件版本、主板配置、CPU版本和速度、总线速度等丰富的硬件设备信息。

语法格式:lshw [参数]

常用参数:

-C 设置设备类型
-X 启动图形界面
-businfo 显示总线相关信息
-enable test 启动测试模式
-html 使用html格式输出结果
-help 显示帮助信息
-json 使用json格式输出结果
-numeric 显示设备的数字ID
-quiet 静默执行模式
-short 使用简要信息模式
-sanitize 移除敏感信息
-version 显示版本信息
-xml 使用xml格式输出结果

参考示例

使用简要信息模式,显示当前系统的全部硬件设备信息:

[root@linuxcool ~]# lshw -short
H/W path           Device      Class      Description
=====================================================
system     VMware Virtual Platform
/0                             bus        440BX Desktop Reference Platform
/0/0                           memory     86KiB BIOS
/0/1                           processor  Intel(R) Core(TM) i5-9300H CPU @ 2.40G
/0/1/0                         memory     16KiB L1 cache
/0/1/1                         memory     16KiB L1 cache
/0/2                           processor  CPU
/0/5                           processor  CPU
………………省略部分输出信息………………

显示当前系统的总线设备相关信息:

[root@linuxcool ~]# lshw -businfo
Bus info          Device      Class      Description
====================================================
system     VMware Virtual Platform
bus        440BX Desktop Reference Platform
memory     86KiB BIOS
cpu@0                         processor  Intel(R) Core(TM) i5-9300H CPU @ 2.40GH
memory     16KiB L1 cache
memory     16KiB L1 cache
cpu@1                         processor  CPU
cpu@2                         processor  CPU
………………省略部分输出信息………………

显示当前系统的内存设备相关信息:

[root@linuxcool ~]# lshw -C memory
*-firmware
description: BIOS
vendor: Phoenix Technologies LTD
physical id: 0
version: 6.00
date: 11/12/2020
size: 86KiB
capabilities: isa pci pcmcia pnp apm upgrade shadowing escd cdboot bootselect edd int5printscreen int9keyboard int14serial int17printer int10video acpi smartbattery biosbootspecification netboot
*-cache:0
description: L1 cache
physical id: 0
slot: L1
size: 16KiB
capacity: 16KiB
capabilities: asynchronous internal write-back
configuration: level=1
………………省略部分输出信息………………
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。