用 lshw 查看完整硬件配置

lshw 可枚举主板、内存插槽、CPU、硬盘型号、网卡等完整硬件信息,升级内存或找驱动前先看它。

Linux硬件lshw 硬件信息系统信息中风险
运行 `sudo lshw -short` 看精简列表,或 `sudo lshw -class memory -class disk` 查看某一类设备。

01命令

命令
$ sudo lshw -short

02作用说明

inxi 提供友好摘要,dmidecode 只读 BIOS 表,而 lshw 会遍历真实硬件树,能看到空闲的内存插槽、每块硬盘的序列号和所用驱动。还支持 -json、-html、-xml 导出,便于做设备清单。

03风险

风险中风险
使用条件lshw package
!注意: 需要 sudo 才能看到内存配置、序列号等详细信息,不加 sudo 会隐藏这些内容。

04撤销

撤销
$ null

05来源

  • lshw(1)
    Arch Linux · community · 2026-09-17
    依据: hardware lister with json/html/xml output support
  • lshw(1) — list hardware configuration
    Debian · community · 2026-09-17
    依据: -short compact summary; -class filters by device class

最后验证: 2026-09-18 · 分类: 系统与设置

06相关方案