lshw linux_Linux lshw命令–获取Linux硬件信息

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
          physi
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值