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查看网卡信息

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查看内存信息

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查看CPU信息

4. 总结

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

欢迎工作一到五年的Java工程师朋友们加入Java高并发: 957734884,

群内提供免费的Java架构学习资料(里面有高可用、高并发、高性能及分布式、Jvm性能调优、Spring源码,MyBatis,Netty,Redis,Kafka,Mysql,Zookeeper,Tomcat,Docker,Dubbo,Nginx等多个知识点的架构资料)

合理利用自己每一分每一秒的时间来学习提升自己,不要再用"没有时间“来掩饰自己思想上的懒惰!趁年轻,使劲拼,给未来的自己一个交代!

猜你喜欢

转载自blog.csdn.net/kukelook/article/details/89388360