CN2.HK 是专业经营国际CN2网络的服务商,为大陆中小企业提供稳定、安全、合规的国际互联网接入服务。

香港云 cn2.hk 香港云 cn2.hk

服务热线:400 888 9543

服务信箱:idc@cn2.hk

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
………………省略部分输出信息………………

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

在线客服