lshw命令详解

lshw 是一个能把我们出去硬件信息的小工具,它能为我们提供内存配置、固件版本、主板配置信息、CPU版本和速度、cache信息、总线速度等。它能运行在 DMI兼容的 x86、IA-64和一些 PowerPC的平台上。目前支持 DMI (x86 and IA-64 only), OpenFirmware device tree (PowerPC only), PCI/AGP, CPUID (x86), IDE/ATA/ATAPI, PCMCIA (only tested on x86), SCSI 和 USB。

参数:

-version       :显示 lshw的版本
-help          :显示帮助信息
-X             :启动图形界面
-html          :将设备信息以 html的格式输出
-xml           :将设备信息以 xml的格式输出
-json          :将设备信息以 json的格式输出
-short         :带有设置路径的简短输出(类似与 HP-UX的 ioscan输出形式)
-businfo       :输出详细的总线信息(包含 SCSI, USB, IDE and PCI地址)
-dump filename :将收集到的信息输出到一个SQLite数据库中
-class class   :仅仅显示指定类型的硬件,在使用 lshw -short or lshw -businfo时我们能见到这写 class,
                 常见的有这些:system、bus、memory、processor、bridge、display、communication、
                          multimedia、network、disk、volume、powoer
-C class       :等同与 -class class
-enable test   :启用测试,测试项能包含这些:
                 dmi (for DMI/SMBIOS extensions)
                 device-tree (for OpenFirmware device tree)
                 spd (for memory Serial Presence Detect)
                 memory (for memory-size guessing heuristics)
                 cpuinfo (for kernel-reported CPU  detection)
                 cpuid  (for  CPU  detection)
                 pci  (for  PCI/AGP access)
                 isapnp  (for ISA PnP extensions)
                 pcmcia (for PCMCIA/PCCARD)
                 ide (for IDE/ATAPI)
                 usb (for USB devices)
                 scsi (for SCSI)
                 network (for net‐work interfaces detection)
-disable test
-quiet         :不现实状态
-sanitize      :移除IP地址、序列号等敏感信息
-numeric       :显示 PCI和USB设备的数字 ID
它在运行的时候会都去下列文件:


/usr/local/share/pci.ids
/usr/share/pci.ids
/etc/pci.ids
/usr/share/hwdata/pci.ids  :A list of all known PCI ID's (vendors, devices, classes and subclasses).
/proc/bus/pci/*            :Used to access the configuration of installed PCI busses and devices.
/proc/ide/*                :Used to access the configuration of installed IDE busses and devices.
/proc/scsi/*, /dev/sg*     :Used to access the configuration of installed SCSI devices.
/dev/cpu/*/cpuid           :Used on x86 platforms to access CPU-specific configuration.
/proc/device-tree/*        :Used on PowerPC platforms to access OpenFirmware configuration.
/proc/bus/usb/*            :Used to access the configuration of installed USB busses and devices.
/sys/*                     :Used on 2.6 kernels to access hardware/driver configuration information.

举例:

#导出 html格式
# lshw -html >info.html
 
#显示设备列表,输出包括设备路径(path)、类别(class)以及简单描述
# lshw -short
  
#显示设备列表,输出包括总线信息、SCSI、USB、IDE、PCI地址等
# lshw -businfo
  
#显示内存相关的硬件
# lshw -C memory
 
#显示网络相关的硬件
# lshw -c network

 

  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值