Linux系统下查看硬件的方法全解析
在 Linux 系统中,查看硬件信息是系统管理和故障排除的重要步骤。通过查看硬件信息,我们可以了解系统的硬件配置、性能以及可能存在的问题。本文将介绍在 Linux 系统上查看硬件的各种方法,包括使用命令行工具和图形界面工具。
一、使用命令行工具查看硬件
1. lshw 命令:
– `lshw` 是一个强大的命令行工具,用于显示系统硬件的详细信息。它可以显示硬件的层次结构、设备名称、制造商、型号、驱动程序等信息。
– 要使用 `lshw` 命令,只需在终端中输入 `lshw` 并按下回车键。它将输出系统硬件的详细信息,包括主板、处理器、内存、存储设备、网络接口等。
– 例如,以下是使用 `lshw` 命令查看系统硬件信息的示例:
“`
$ lshw
*-cpu
description: CPU
product: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
vendor: Intel Corporation
physical id: 4
bus info: cpu@0
version: CPU 9.2.11
slot: U3E1
size: 2560MHz
capacity: 4801MHz
width: 64 bits
clock: 100MHz
*-memory
description: System Memory
physical id: 60
slot: DIMM 0
size: 16GB
width: 64 bits
clock: 2666MHz
*-pci
description: Host bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1400
bus info: pci@0000:00:00.0
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1402
bus info: pci@0000:00:02.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1404
bus info: pci@0000:00:04.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1406
bus info: pci@0000:00:06.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1408
bus info: pci@0000:00:08.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 140a
bus info: pci@0000:00:0a.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 140c
bus info: pci@0000:00:0c.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 140e
bus info: pci@0000:00:0e.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1410
bus info: pci@0000:00:10.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1412
bus info: pci@0000:00:12.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1414
bus info: pci@0000:00:14.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1416
bus info: pci@0000:00:16.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1418
bus info: pci@0000:00:18.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 141a
bus info: pci@0000:00:1a.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 141c
bus info: pci@0000:00:1c.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 141e
bus info: pci@0000:00:1e.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1420
bus info: pci@0000:00:20.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1422
bus info: pci@0000:00:22.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1424
bus info: pci@0000:00:24.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1426
bus info: pci@0000:00:26.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1428
bus info: pci@0000:00:28.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 142a
bus info: pci@0000:00:2a.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 142c
bus info: pci@0000:00:2c.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 142e
bus info: pci@0000:00:2e.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1430
bus info: pci@0000:00:30.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1432
bus info: pci@0000:00:32.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1434
bus info: pci@0000:00:34.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1436
bus info: pci@0000:00:36.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 1438
bus info: pci@0000:00:38.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 143a
bus info: pci@0000:00:3a.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 143c
bus info: pci@0000:00:3c.0
size: 256MB
*-pci
description: PCI bridge
product: Intel Corporation Device 3e9b
vendor: Intel Corporation
physical id: 143e
bus info: pci@0000:00:3e.0
size: 256MB
“`
– 在上述示例中,`lshw` 命令输出了系统的 CPU、内存和各种 PCI 设备的详细信息。
2. dmidecode 命令:
– `dmidecode` 命令用于显示系统 DMI(Desktop Management Interface)信息,包括主板、处理器、内存、BIOS 等硬件的详细信息。
– 要使用 `dmidecode` 命令,只需在终端中输入 `dmidecode` 并按下回车键。它将输出系统硬件的详细信息,包括制造商、型号、序列号、BIOS 版本等。
– 例如,以下是使用 `dmidecode` 命令查看系统硬件信息的示例:
“`
$ dmidecode
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
Vendor: American Megatrends International LLC
Version: P1.20
Release Date: 07/16/2019
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 4 MB
Characteristics:
Pci is supported
Powered by ACPI
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
EDD is supported
5.25″/1.2 MB floppy services are supported (int 13h)
3.5″/720 kB floppy services are supported (int 13h)
3.5″/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
ACPI is supported
USB legacy is supported
BIOS boot specification is supported
Targeted content distribution is supported
UEFI is supported
Handle 0x0001, DMI type 1, 27 bytes
System Information
Manufacturer: Dell Inc.
Product Name: Latitude 7490
Version: 1.0
Serial Number: [SERIAL_NUMBER]
Wake-up Type: Power Switch
SKU Number: [SKU_NUMBER]
Family: Latitude
Handle 0x0002, DMI type 2, 13 bytes
Base Board Information
Manufacturer: Dell Inc.
Product Name: 082J08
Version: A00
Serial Number: [SERIAL_NUMBER]
Asset Tag: [ASSET_TAG]
Features:
Board is a hosting board
Board is replaceable
Board is hot-pluggable
Board is serviceable
Board is removable
Board is upgradeable
Handle 0x0003, DMI type 3, 23 bytes
Processor Information
Processor ID: [PROCESSOR_ID]
Processor Version: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Processor Family: 6
Processor Manufacturer: Intel Corporation
Processor Type: 8086
Processor Speed: 2560 MHz
External Clock: 100 MHz
Max Speed: 4801 MHz
Current Speed: 2560 MHz
Status: Populated, Enabled
Upgrade: Socket 4, LGA 14nm
Serial Number: [SERIAL_NUMBER]
Asset Tag: [ASSET_TAG]
Part Number: [PART_NUMBER]
Handle 0x0004, DMI type 4, 20 bytes
Cache Information
Level: 1
Type: Data
Size: 32 KB
Associativity: 8
Cache Type: Write Back
Line Size: 64 Bytes
Status: Populated, Enabled
Upgrade: Socket 4, LGA 14nm
Handle 0x0005, DMI type 4, 20 bytes
Cache Information
Level: 2
Type: Unified
Size: 256 KB
Associativity: 8
Cache Type: Write Back
Line Size: 64 Bytes
Status: Populated, Enabled
Upgrade: Socket 4, LGA 14nm
Handle 0x0006, DMI type 4, 20 bytes
Cache Information
Level: 3
Type: Unified
Size: 12 MB
Associativity: 16
Cache Type: Write Back
Line Size: 64 Bytes
Status: Populated, Enabled
Upgrade: Socket 4, LGA 14nm
Handle 0x0007, DMI type 5, 37 bytes
On-Board Devices
Device 0:
Description: Audio device
Manufacturer: Intel Corporation
Physical Id: 1f.3
Serial Number: [SERIAL_NUMBER]
Location Information: Internal
Bus Information: pci@0000:00:1f.3
Logical Name: /dev/snd/controlC0
Max Module Size: 0x20000
Module Type: PCI
Driver Version: 8.0.0
Driver Name: snd_hda_intel
Driver Attributes: Final
Device Enabled: Yes
Current Available (mA): 500
Maximum Available (mA): 500
Power Management Version: 1
Handle 0x0008, DMI type 5, 37 bytes
On-Board Devices
Device 1:
Description: Network controller
Manufacturer: Intel Corporation
Physical Id: 1f.2
Serial Number: [SERIAL_NUMBER]
Location Information: Internal
Bus Information: pci@0000:00:1f.2
Logical Name: /dev/net/tun
Max Module Size: 0x20000
Module Type: PCI
Driver Version: 24.0.0
Driver Name: iwlwifi
Driver Attributes: Final
Device Enabled: Yes