Linux怎麼查看硬件信息之lshw命令

lshw工具簡介

本文主要介紹lshw命令,該命令是Linux系統管理中較為常用的一個命令行工具,用於查看硬件信息。多數Linux發行版默認情況下並沒有集成該工具,本文將會講解如何利用lshw命令查看服務器硬件信息。

安裝工具:

CentOS7.6為例:

[root@zcwyou ~]# yum -y install lshw
Linux怎麼查看硬件信息之lshw命令

Linux安裝lshw

1. 查看網卡信息

命令:

[root@zcwyou ~]# lshw -C network

輸出信息:

*-network

description: Ethernet interface

product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller

vendor: Realtek Semiconductor Co., Ltd.

physical id: 0

bus info: pci@0000:01:00.0

logical name: eth0

version: 05

serial: 00:e0:4c:36:01:8b

size: 100Mbit/s

capacity: 100Mbit/s

width: 64 bits

clock: 33MHz

capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation

configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl_nic/rtl8105e-1.fw ip=59.37.83.138 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s

resources: irq:26 ioport:e800(size=256) memory:fdfff000-fdffffff(prefetchable) memory:fdff8000-fdffbfff(prefetchable)

Linux怎麼查看硬件信息之lshw命令

Linux使用lshw查看網卡信息

2. 查看內存信息

命令:

[root@zcwyou ~]# lshw -C memory

輸出信息:

*-firmware

description: BIOS

vendor: Dell Inc.

physical id: 0

version: 1.13.0

date: 03/02/2018

size: 64KiB

capacity: 4MiB

capabilities: isa pci pnp upgrade shadowing cdboot bootselect edd int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 int9keyboard int14serial int10video acpi usb biosbootspecification netboot

*-cache:0

description: L1 cache

physical id: 700

size: 128KiB

capacity: 128KiB

capabilities: internal write-back data

configuration: level=1

*-cache:1

description: L2 cache

physical id: 701

size: 1MiB

capacity: 2MiB

capabilities: internal write-back unified

configuration: level=2

*-cache:2

description: L3 cache

physical id: 702

size: 12MiB

capacity: 12MiB

capabilities: internal write-back unified

configuration: level=3

*-memory

description: System Memory

physical id: 1000

slot: System board or motherboard

size: 32GiB

capabilities: ecc

configuration: errordetection=multi-bit-ecc

*-bank:0

description: DIMM DDR3 Synchronous Registered (Buffered) 1333 MHz (0.8 ns)

product: M393B1K70DH0-YH9

vendor: 00CE00B380CE

physical id: 0

serial: 83BB0BB1

slot: DIMM_A1

size: 8GiB

width: 64 bits

clock: 1333MHz (0.8ns)

*-bank:1

description: DIMM DDR3 Synchronous Registered (Buffered) 1333 MHz (0.8 ns)

product: M393B1K70DH0-YH9

vendor: 00CE00B380CE

physical id: 1

serial: 83BB0BB0

slot: DIMM_A2

size: 8GiB

width: 64 bits

clock: 1333MHz (0.8ns)

*-bank:2

description: DIMM DDR3 Synchronous Registered (Buffered) 1333 MHz (0.8 ns)

product: M393B1K70DH0-YH9

vendor: 00CE00B380CE

physical id: 2

serial: 83BB0BDD

slot: DIMM_A3

size: 8GiB

width: 64 bits

clock: 1333MHz (0.8ns)

*-bank:3

description: DIMM DDR3 Synchronous Registered (Buffered) 1333 MHz (0.8 ns)

product: M393B1K70DH0-YH9

vendor: 00CE00B380CE

physical id: 3

serial: 83BB0BAC

slot: DIMM_A4

size: 8GiB

width: 64 bits

clock: 1333MHz (0.8ns)

*-bank:4

description: DIMM DDR3 Synchronous [empty]

physical id: 4

slot: DIMM_B1

width: 64 bits

*-bank:5

description: DIMM DDR3 Synchronous [empty]

physical id: 5

slot: DIMM_B2

width: 64 bits

*-bank:6

description: DIMM DDR3 Synchronous [empty]

physical id: 6

slot: DIMM_B3

width: 64 bits

*-bank:7

description: DIMM DDR3 Synchronous [empty]

physical id: 7

slot: DIMM_B4

width: 64 bits

Linux怎麼查看硬件信息之lshw命令

Linux使用lshw查看內存信息

3. 查看CPU信息

不需要使用lshw命令

[root@zcwyou ~]# cat /proc/cpuinfo |more

輸出結果:

processor : 0

vendor_id : GenuineIntel

cpu family : 6

model : 45

model name : Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz

stepping : 7

microcode : 0x710

cpu MHz : 2294.471

cache size : 15360 KB

physical id : 0

siblings : 2

core id : 0

cpu cores : 2

apicid : 0

initial apicid : 0

fpu : yes

fpu_exception : yes

cpuid level : 13

wp : yes

flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xt

opology tsc_reliable nonstop_tsc cpuid aperfmperf pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm epb pti tsc_adjust dtherm ida

arat pln pts

bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf

bogomips : 4588.94

clflush size : 64

cache_alignment : 64

address sizes : 42 bits physical, 48 bits virtual

power management:

Linux怎麼查看硬件信息之lshw命令

Linux使用lshw查看CPU信息

4. 總結

Linux使用lshw查看各種硬件信息。

原文鏈接:

https://www.linuxrumen.com/cyml/386.html

點擊瞭解更多,快速查看更多的技術文章列表。


分享到:


相關文章: