linux 安装lshw_linux lshw - CSDN
  • Linuxlshw命令

    2016-04-16 11:53:40
    lshw(Hardware Lister)是另外一个可以查看硬件信息的工具,不仅如此,它还可以用来做一些硬件的benchmark。 这个工具其实就是用/proc里面读取一些文件来显示相关的信息,它用到了如下文件和目录(下的文件): /...

    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

    用法:

    最简单的用法:

    # lshw
    和dmidecode一样,输出一大堆的东西。

    以html/xml格式输出

    # lshw -html >info.html
    # lshw -xml >info.xml

    路径与类别

    输出包括设备路径(path)、类别(class)以及简单描述
    # lshw -short

    总线等

    输出包括总线信息、SCSI、USB、IDE、PCI地址等。
    # lshw -businfo

    显示指定类别的设备

    # lshw -C class
    # lshw -class class
    这里的class可以通过lshw -short来查看。比如
    # lshw -C memory

    展开全文
  • lshw

    2017-11-07 17:08:06
    lshw 用于显示系统所有的硬件信息 实际运行结果如下:

    lshw 用于显示系统所有的硬件信息

    实际运行结果如下:


    展开全文
  • lshw linuxLinux lshw command lists all the hardware configuration of the system. Linux lshw命令列出了系统的所有硬件配置。 Some of the common information we can extract from the lshw command are: 我们...

    lshw linux

    Linux lshw command lists all the hardware configuration of the system.

    Linux lshw命令列出了系统的所有硬件配置。

    Some of the common information we can extract from the lshw command are:

    我们可以从lshw命令提取的一些常见信息是:

    • RAM Memory information

      RAM内存信息
    • CPU configurations

      CPU配置
    • Motherboard information

      主板信息
    • Harddisk information

      硬盘信息
    • Network devices information

      网络设备信息

    Linux lshw命令功能 (Linux lshw Command Features)

    • Ability to produce the output in various formats such as XML, JSON, and HTML.

      能够产生各种格式的输出,例如XML,JSON和HTML。
    • We can dump the output to a file easily using the redirection operator.

      我们可以使用重定向运算符轻松地将输出转储到文件中。
    • The default output contains a lot of information, we can get specific hardware information using various options.

      默认输出包含很多信息,我们可以使用各种选项来获取特定的硬件信息。
    • Supports GUI too, useful for Desktop environments only. Most of the time, we run these commands on a Linux server where we don’t have GUI software.

      也支持GUI,仅对桌面环境有用。 大多数时候,我们在没有GUI软件的Linux服务器上运行这些命令。

    lshw命令限制 (lshw command limitations)

    • It doesn’t detect Firewire devices as of now.

      到目前为止,它还没有检测到Firewire设备。
    • It must be run as a superuser, either root or with sudo, to get the correct hardware details.

      它必须以超级用户身份(以root或sudo身份)运行,以获取正确的硬件详细信息。
    • I found that -dump option to save the output in a file is not working.

      我发现-dump选项无法将输出保存到文件中。

    Linux硬件信息示例 (Linux Hardware Information Examples)

    Let’s look at some examples to get the linux hardware information using the lshw command.

    让我们看一些使用lshw命令获取linux硬件信息的示例。

    1.获取完整的Linux硬件信息 (1. Getting Complete Linux Hardware Information)

    
    root@localhost:~# sudo lshw
    localhost                   
        description: Computer
        product: Standard PC (Q35 + ICH9, 2009)
        vendor: QEMU
        version: pc-q35-3.1
        width: 64 bits
        capabilities: smbios-2.8 dmi-2.8 vsyscall32
        configuration: boot=normal
      *-core
           description: Motherboard
           physical id: 0
         *-firmware
              description: BIOS
              vendor: SeaBIOS
              physical id: 0
              version: rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org
              date: 04/01/2014
              size: 96KiB
         *-cpu
              description: CPU
              product: AMD EPYC 7501 32-Core Processor
              vendor: Advanced Micro Devices [AMD]
              physical id: 400
              bus info: cpu@0
              version: pc-q35-3.1
              slot: CPU 0
              size: 2GHz
              capacity: 2GHz
              width: 64 bits
              capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp x86-64 rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibpb vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 virt_ssbd arat
              configuration: cores=1 enabledcores=1 threads=1
         *-memory
              description: System Memory
              physical id: 1000
              size: 2GiB
              capacity: 2GiB
              capabilities: ecc
              configuration: errordetection=multi-bit-ecc
            *-bank
                 description: DIMM RAM
                 vendor: QEMU
                 physical id: 0
                 slot: DIMM 0
                 size: 2GiB
         *-pci
              description: Host bridge
              product: 82G33/G31/P35/P31 Express DRAM Controller
              vendor: Intel Corporation
              physical id: 100
              bus info: pci@0000:00:00.0
              version: 00
              width: 32 bits
              clock: 33MHz
            *-display UNCLAIMED
                 description: VGA compatible controller
                 physical id: 1
                 bus info: pci@0000:00:01.0
                 version: 02
                 width: 32 bits
                 clock: 33MHz
                 capabilities: vga_controller
                 configuration: latency=0
                 resources: memory:fd000000-fdffffff memory:febd0000-febd0fff memory:c0000-dffff
            *-scsi:0
                 description: SCSI storage controller
                 product: Virtio SCSI
                 vendor: Red Hat, Inc.
                 physical id: 2
                 bus info: pci@0000:00:02.0
                 version: 00
                 width: 64 bits
                 clock: 33MHz
                 capabilities: scsi msix bus_master cap_list
                 configuration: driver=virtio-pci latency=0
                 resources: irq:22 ioport:c000(size=64) memory:febd1000-febd1fff memory:fe000000-fe003fff
               *-virtio0 UNCLAIMED
                    description: Virtual I/O device
                    physical id: 0
                    bus info: virtio@0
                    configuration: driver=virtio_scsi
            *-scsi:1
                 description: SCSI storage controller
                 product: Virtio SCSI
                 vendor: Red Hat, Inc.
                 physical id: 3
                 bus info: pci@0000:00:03.0
                 version: 00
                 width: 64 bits
                 clock: 33MHz
                 capabilities: scsi msix bus_master cap_list
                 configuration: driver=virtio-pci latency=0
                 resources: irq:23 ioport:c040(size=64) memory:febd2000-febd2fff memory:fe004000-fe007fff
               *-virtio1 UNCLAIMED
                    description: Virtual I/O device
                    physical id: 0
                    bus info: virtio@1
                    configuration: driver=virtio_scsi
            *-network
                 description: Ethernet controller
                 product: Virtio network device
                 vendor: Red Hat, Inc.
                 physical id: 4
                 bus info: pci@0000:00:04.0
                 version: 00
                 width: 64 bits
                 clock: 33MHz
                 capabilities: msix bus_master cap_list rom
                 configuration: driver=virtio-pci latency=0
                 resources: irq:20 ioport:c0c0(size=32) memory:febd3000-febd3fff memory:fe008000-fe00bfff memory:feb80000-febbffff
               *-virtio2
                    description: Ethernet interface
                    physical id: 0
                    bus info: virtio@2
                    logical name: eth0
                    serial: f2:3c:92:d4:76:9e
                    capabilities: ethernet physical
                    configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 ip=45.79.122.188 link=yes multicast=yes
            *-isa
                 description: ISA bridge
                 product: 82801IB (ICH9) LPC Interface Controller
                 vendor: Intel Corporation
                 physical id: 1f
                 bus info: pci@0000:00:1f.0
                 version: 02
                 width: 32 bits
                 clock: 33MHz
                 capabilities: isa
                 configuration: driver=lpc_ich latency=0
                 resources: irq:0
            *-storage
                 description: SATA controller
                 product: 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
                 vendor: Intel Corporation
                 physical id: 1f.2
                 bus info: pci@0000:00:1f.2
                 version: 02
                 width: 32 bits
                 clock: 33MHz
                 capabilities: storage msi ahci_1.0 bus_master cap_list
                 configuration: driver=ahci latency=0
                 resources: irq:31 ioport:c0e0(size=32) memory:febd4000-febd4fff
            *-serial UNCLAIMED
                 description: SMBus
                 product: 82801I (ICH9 Family) SMBus Controller
                 vendor: Intel Corporation
                 physical id: 1f.3
                 bus info: pci@0000:00:1f.3
                 version: 02
                 width: 32 bits
                 clock: 33MHz
                 configuration: latency=0
                 resources: ioport:700(size=64)
         *-scsi:0
              physical id: 1
              logical name: scsi0
            *-disk
                 description: EXT4 volume
                 product: QEMU HARDDISK
                 vendor: Linux
                 physical id: 0.0.0
                 bus info: scsi@0:0.0.0
                 logical name: /dev/sda
                 logical name: /
                 version: 1.0
                 serial: ccf427b1-b94a-4237-b067-d9e9fc34756f
                 size: 49GiB
                 capabilities: 5400rpm journaled extended_attributes large_files huge_files dir_nlink recover extents ext4 ext2 initialized
                 configuration: ansiversion=5 created=2020-02-19 14:27:58 filesystem=ext4 lastmountpoint=/ logicalsectorsize=512 modified=2020-04-28 08:10:42 mount.fstype=ext4 mount.options=rw,relatime,errors=remount-ro,data=ordered mounted=2020-04-28 08:10:43 sectorsize=512 state=mounted
         *-scsi:1
              physical id: 2
              logical name: scsi1
            *-disk
                 description: Linux swap volume
                 product: QEMU HARDDISK
                 vendor: QEMU
                 physical id: 0.1.2
                 bus info: scsi@1:0.1.2
                 logical name: /dev/sdb
                 version: 1
                 serial: 179fdb40-6f5a-4973-99fd-2c0dfee57907
                 size: 512MiB
                 capacity: 512MiB
                 capabilities: 5400rpm swap initialized
                 configuration: ansiversion=5 filesystem=swap logicalsectorsize=512 pagesize=4096 sectorsize=512
    root@localhost:~# 
    
    

    As you can see that it’s a lot of information, if you want quick hardware information, then run it with -short option.

    如您所见,其中包含很多信息,如果您需要快速的硬件信息,请使用-short选项运行它。

    
    root@localhost:~# sudo lshw -short
    H/W path     Device    Class      Description
    =============================================
                           system     Standard PC (Q35 + ICH9, 2009)
    /0                     bus        Motherboard
    /0/0                   memory     96KiB BIOS
    /0/400                 processor  AMD EPYC 7501 32-Core Processor
    /0/1000                memory     2GiB System Memory
    /0/1000/0              memory     2GiB DIMM RAM
    /0/100                 bridge     82G33/G31/P35/P31 Express DRAM Controller
    /0/100/1               display    VGA compatible controller
    /0/100/2               storage    Virtio SCSI
    /0/100/2/0             generic    Virtual I/O device
    /0/100/3               storage    Virtio SCSI
    /0/100/3/0             generic    Virtual I/O device
    /0/100/4               network    Virtio network device
    /0/100/4/0   eth0      network    Ethernet interface
    /0/100/1f              bridge     82801IB (ICH9) LPC Interface Controller
    /0/100/1f.2            storage    82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]
    /0/100/1f.3            bus        82801I (ICH9 Family) SMBus Controller
    /0/1         scsi0     storage    
    /0/1/0.0.0   /dev/sda  volume     49GiB QEMU HARDDISK
    /0/2         scsi1     storage    
    /0/2/0.1.2   /dev/sdb  volume     512MiB QEMU HARDDISK
    root@localhost:~# 
    

    2.获取Linux CPU信息 (2. Getting Linux CPU Information)

    We can run lshw -C class_name to get the specific hardware class information. Let’s see how to get the CPU information.

    我们可以运行lshw -C class_name来获取特定的硬件类信息。 让我们看看如何获​​取CPU信息。

    
    root@localhost:~# sudo lshw -C cpu
      *-cpu                     
           description: CPU
           product: AMD EPYC 7501 32-Core Processor
           vendor: Advanced Micro Devices [AMD]
           physical id: 400
           bus info: cpu@0
           version: pc-q35-3.1
           slot: CPU 0
           size: 2GHz
           capacity: 2GHz
           width: 64 bits
           capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp x86-64 rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw perfctr_core ssbd ibpb vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 virt_ssbd arat
           configuration: cores=1 enabledcores=1 threads=1
    root@localhost:~# 
    

    If you have multiple CPUs, then the command will provide information of all the CPUs.

    如果您有多个CPU,则该命令将提供所有CPU的信息。

    The lshw -C processor command will also print the CPU information.

    lshw -C processor命令还将打印CPU信息。

    If you are not sure of the Class name, then look at it in the lshw short output.

    如果不确定类名,请在lshw short输出中查看它。

    3.获取Linux内存信息 (3. Getting Linux Memory Information)

    
    root@localhost:~# sudo lshw -C memory
      *-firmware                
           description: BIOS
           vendor: SeaBIOS
           physical id: 0
           version: rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org
           date: 04/01/2014
           size: 96KiB
      *-memory
           description: System Memory
           physical id: 1000
           size: 2GiB
           capacity: 2GiB
           capabilities: ecc
           configuration: errordetection=multi-bit-ecc
         *-bank
              description: DIMM RAM
              vendor: QEMU
              physical id: 0
              slot: DIMM 0
              size: 2GiB
    root@localhost:~# 
    

    4.获取Linux硬盘信息 (4. Getting Linux Harddisk Information)

    
    root@localhost:~# sudo lshw -C storage
    

    5.获取Linux主板信息 (5. Getting Linux Motherboard Information)

    
    root@localhost:~# sudo lshw -C bus
      *-core                    
           description: Motherboard
           physical id: 0
      *-serial UNCLAIMED
           description: SMBus
           product: 82801I (ICH9 Family) SMBus Controller
           vendor: Intel Corporation
           physical id: 1f.3
           bus info: pci@0000:00:1f.3
           version: 02
           width: 32 bits
           clock: 33MHz
           configuration: latency=0
           resources: ioport:700(size=64)
    root@localhost:~# 
    

    6.获取Linux网络接口信息 (6. Getting Linux Network Interfaces Information)

    
    root@localhost:~# sudo lshw -C network
      *-network                 
           description: Ethernet controller
           product: Virtio network device
           vendor: Red Hat, Inc.
           physical id: 4
           bus info: pci@0000:00:04.0
           version: 00
           width: 64 bits
           clock: 33MHz
           capabilities: msix bus_master cap_list rom
           configuration: driver=virtio-pci latency=0
           resources: irq:20 ioport:c0c0(size=32) memory:febd3000-febd3fff memory:fe008000-fe00bfff memory:feb80000-febbffff
         *-virtio2
              description: Ethernet interface
              physical id: 0
              bus info: virtio@2
              logical name: eth0
              serial: f2:3c:92:d4:76:9e
              capabilities: ethernet physical
              configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 ip=45.79.122.188 link=yes multicast=yes
    root@localhost:~# 
    

    7. HTML,XML和JSON格式的Linux硬件信息 (7. Linux Hardware Information in HTML, XML, and JSON Formats )

    The default output of lshw command is in plain text. We can get the output in HTML, XML, and JSON formats by specifying corresponding options.

    lshw命令的默认输出为纯文本。 通过指定相应的选项,我们可以获得HTML,XML和JSON格式的输出。

    XML:

    XML:

    
    root@localhost:~# sudo lshw -C bus -xml
    <?xml version="1.0" standalone="yes" ?>
    <!-- generated by lshw-B.02.18 -->
    <!-- GCC 7.3.0 -->
    <!-- Linux 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 -->
    <!-- GNU libc 2 (glibc 2.27) -->
    <list>
      <node id="core" claimed="true" class="bus" handle="">
       <description>Motherboard</description>
       <physid>0</physid>
      <node id="serial" class="bus" handle="PCI:0000:00:1f.3">
       <description>SMBus</description>
       <product>82801I (ICH9 Family) SMBus Controller</product>
       <vendor>Intel Corporation</vendor>
       <physid>1f.3</physid>
       <businfo>pci@0000:00:1f.3</businfo>
       <version>02</version>
       <width units="bits">32</width>
       <clock units="Hz">33000000</clock>
       <configuration>
        <setting id="latency" value="0" />
       </configuration>
       <resources>
        <resource type="ioport" value="700(size=64)" />
       </resources>
      </node>
      </node>
    </list>
    root@localhost:~# 
    

    JSON:

    JSON:

    
    root@localhost:~# sudo lshw -C memory -json
              {                 
        "id" : "firmware",
        "class" : "memory",
        "claimed" : true,
        "description" : "BIOS",
        "vendor" : "SeaBIOS",
        "physid" : "0",
        "version" : "rel-1.12.0-0-ga698c8995f-prebuilt.qemu.org",
        "date" : "04/01/2014",
        "units" : "bytes",
        "size" : 98304
      },
                {
        "id" : "memory",
        "class" : "memory",
        "claimed" : true,
        "handle" : "DMI:1000",
        "description" : "System Memory",
        "physid" : "1000",
        "units" : "bytes",
        "size" : 2147483648,
        "capacity" : 2147483648,
        "configuration" : {
          "errordetection" : "multi-bit-ecc"
        },
        "capabilities" : {
          "ecc" : "Multi-bit error-correcting code (ECC)"
        },
        "children" : [
          {
            "id" : "bank",
            "class" : "memory",
            "claimed" : true,
            "handle" : "DMI:1100",
            "description" : "DIMM RAM",
            "vendor" : "QEMU",
            "physid" : "0",
            "slot" : "DIMM 0",
            "units" : "bytes",
            "size" : 2147483648
          }
        ]
      },
                                                                                              
    root@localhost:~# 
    

    HTML:

    HTML:

    
    root@localhost:~# sudo lshw -C memory -html
    

    8.将Linux硬件信息保存到文件中 (8. Saving Linux Hardware Information to a File)

    I tried to use the -dump option with the lshw command but it didn’t worked for me. But, we can always use the redirection operator (>) to save it into a new file.

    我尝试将-dump选项与lshw命令一起使用,但对我而言不起作用。 但是,我们始终可以使用重定向运算符(>)将其保存到新文件中。

    
    # sudo lshw -html > hardware_info.html
    
    Linux Hardware Information Lshw Html File
    Linux Hardware Information – lshw Html File
    Linux硬件信息– lshw HTML文件

    结论 (Conclusion)

    Linux lshw command is a simple tool to get the complete hardware information. The various options to get the specific hardware information and in multiple formats such as HTML and JSON is very useful in sharing the details with others also.

    Linux lshw命令是获取完整硬件信息的简单工具。 获取特定硬件信息以及多种格式(例如HTML和JSON)的各种选项对于与其他人共享详细信息也非常有用。

    Reference: HardwareLiSter

    参考HardwareLiSter

    翻译自: https://www.journaldev.com/39487/linux-lshw-command-linux-hardware-info

    lshw linux

    展开全文
  • 使用lshw工具查看linux的系统硬件信息sudo lshwsudo lshw -shortsudo lshw - html > lshw.html

    使用lshw工具查看linux的系统硬件信息

    sudo lshw
    
    sudo lshw -short
    
    sudo lshw - html > lshw.html
    展开全文
  • Linux安装NVIDIA显卡驱动的正确姿势 什么是nouveau驱动? 检测NVIDIA驱动是否成功安装 集显与独显的切换 使用标准仓库进行自动化安装 使用PPA仓库进行自动化安装 使用官方的NVIDIA驱动进行手动安装 Linux...
  • 注意:如有提示命令找不到command not found,请自行安装所需命令。 1、lshw查看所有硬件摘要信息 下面命令可以查看所有硬件摘要信息,并输出成一个html文件,把此html文件导出到电脑上,直接打开,可以清楚的看到...
  • Linux安装网卡驱动

    2019-09-16 11:41:56
    **Backgroud:**公司需要使用旧的fedora系统配合内部测试环境使用,...没多想直接把网卡配置删了,导致nmcli connection show 也看不到网卡设备,重启电脑也无效,所以只能尝试重新安装网卡驱动了,结果还真能用了!...
  • 软件包不存在时可能是被安装软件的软件源没有安装,我的是cent os,安装w3m时,出现这个问题,解决办法:先安装软件源(epel-release),然后更新系统包,最后执行安装软件操作,就可以成功了。以安装w3m为例: 1、...
  • 安装Nvidia GPU驱动 Centos7.7安装Nvidia GPU驱动 Centos7.7安装Nvidia GPU驱动及CUDA以及tensorflow-GPU 原文链接:https://blog.csdn.net/gy87900311/article/details/105074940 Ubuntu 18.04安装Nvidia GPU驱动 ...
  • 安装TensorFlow的GPU版本真的不是一件容易的事,好难,网上的各种安装教程倒是不少,但是基本没有一个能完全照着那种方法就能安装成功的,甚至有些连最基本的一些必需的步骤都没写到,那样子的话能安装到位才是奇迹...
  • linux安装网卡驱动程序
  • 安装: sudo apt-get install hardinfo 启动: 实际上这些信息都可以通过lshw进行查看,参考:https://linux.die.net/man/1/lshw
  • linux安装nivada卡驱动程序第一步, 第一步,
  • linux安装nvidia driver

    2017-04-24 14:21:42
    requirements Ubuntu 16.04python 2.7Flasktensorflow GPU 版本 安装nvidia driver 经过不断踩坑的安装,终于google到了靠谱的...sudo lshw -numeric -C display 可以看到你的显卡信息,比如我的就是 product: GM1
  • Linux下显示硬件信息--lshw lshwlshw(Hardware Lister)是另外一个可以查看硬件信息的工具,不仅如此,它还可以用来做一些硬件的benchmark。这个工具其实就是用/proc里面读取一些文件来显示相关的信息,它用到...
  • Linux系统中,有许多命令可用于查询主机的硬件信息。一些命令只针对特定的硬件组件,比如CPU、内存,一些命令可以查询多个硬件信息。 这篇文章只是简单的让每个人了解查询硬件信息的基本命令使用,包括lscpu、...
  • sudo lshw everestubuntu下的“设备管理器”#1 帖子 由 gezhaowan » 2010-07-23 14:56HardInfo 可以用来采集系统硬件和操作系统方面的相关信息、执行标准检查程序,并能够生成可供打印的HTML或者纯文本格...
1 2 3 4 5 ... 20
收藏数 2,148
精华内容 859
关键字:

linux 安装lshw