[转]Linux下显示硬件信息--lshw

lshw
 lshw(Hardware Lister)是另外一个可以查看硬件信息的工具,不仅如此,它还可以用来做一些硬件的benchmark。
 这个工具其实就是用/proc里面读取一些文件来显示相关的信息,它用到了如下文件和目录(下的文件):
 /proc/cpuinfo  显示CPU信息
 /proc/bus/pci  显示pci信息
 /proc/scsi   显示scsi信息
 /proc/net/dev  显示网络设备信息
 /proc/kcore   从内存映像读取相关信息
 /proc/ide   显示IDE设备信息
 /proc/devices
 /proc/mounts
 /proc/fstab

 下载和安装:
 -------------------------------------------------------------
 cd /tmp
 wget http://ezix.org/software/files/lshw-B.02.14.tar.gz 
 tar lshw-B.02.14.tar.gz
 cd lshw-B.02.14
 make && make install
 -------------------------------------------------------------
 用法:
 1.最简单的用法:
 # lshw
 和dmidecode一样,输出一大堆的东西。
 
 2. 以html/xml格式输出
 # lshw -html >info.html 
 # lshw -xml >info.xml

 3. 显示设备列表,输出包括设备路径(path)、类别(class)以及简单描述
 # lshw -short
 
 4. 显示设备列表,输出包括总线信息、SCSI、USB、IDE、PCI地址等。
 # lshw -businfo 
 
 5. 显示指定类别的设备
 # lshw -C class 
 # lshw -class class 
 这里的class可以通过lshw -short来查看。比如
 # lshw -C memory 
 

6. 查看帮助

# lshw -h
Hardware Lister (lshw) - B.02.14
usage: lshw [-format] [-options ...]
       lshw -version

        -version        print program version (B.02.14)

format can be
        -html           output hardware tree as HTML
        -xml            output hardware tree as XML
        -short          output hardware paths
        -businfo        output bus information

options can be
        -class CLASS    only show a certain class of hardware
        -C CLASS        same as '-class CLASS'
        -c CLASS        same as '-class CLASS'
        -disable TEST   disable a test (like pci, isapnp, cpuid, etc. )
        -enable TEST    enable a test (like pci, isapnp, cpuid, etc. )
        -quiet          don't display status
        -sanitize       sanitize output (remove sensitive information like serial numbers, etc.)
        -numeric        output numeric IDs (for PCI, USB, etc.)


 相对来说lshw相信的信息比较简单。

本文摘自:http://www.sanotes.net/html/y2009/316.html, http://jiajun.iteye.com/blog/656709 

原文地址:https://www.cnblogs.com/fengaix6/p/3880897.html