Linux 查看系统硬件信息344


Linux 操作系统提供了多种工具和命令,可用于查看有关系统硬件的信息,包括 CPU、内存、存储、网络设备和外围设备。以下列出的命令和工具将帮助你深入了解 Linux 系统的硬件组件。

命令行工具

lscpu

lscpu 命令提供有关 CPU 架构、频率、数量和功能的详细信息。
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 158
Model name: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
CPU MHz: 2799.991
CPU max MHz: 3.80000
CPU min MHz: 1200.000
BogoMIPS: 5599.99
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
NUMA node0 CPU(s): 0-7
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt clwb cqm rdt_a rdt_cpb intel_pt tpr_sync ibrs_enhanced ibpb_enhanced stibp_enhanced tsc_idempotent dtherm ida arat pln pts

free

free 命令显示有关物理内存和交换空间的详细信息。
$ free
total used free shared buff/cache available
Mem: 8187032 4041520 162432 233016 2521080 3011996
Swap: 0 0 0

df

df 命令显示有关文件系统和存储设备的信息。
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 233G 39G 184G 18% /
/dev/sda2 500M 59M 416M 13% /boot/efi
/dev/sda3 1.8T 1.1T 642G 64% /home
/dev/sda4 233G 66G 158G 30% /mnt/data

lspci

lspci 命令列出系统中安装的 PCI 和 PCIe 设备。
$ lspci -v
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 0e)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04)
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 31)
00:16.0 Communication controller: Intel Corporation Device 0a0c (rev 10)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port 5 (rev f4)
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port 7 (rev f4)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port 1 (rev f4)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 31)
00:1f.2 SATA controller: Intel Corporation Sunrise Point-LP SATA AHCI Controller (rev 31)
00:1f.3 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 31)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
02:00.0 Network controller: Intel Corporation Wireless-AC 9560 (rev 3a)
03:00.0 Bluetooth: Intel Corporation Wireless Bluetooth (rev 3a)

dmidecode

dmidecode 命令解码 DMI (桌面管理接口) 表,它包含有关系统 BIOS、基板、处理器、内存和底板的信息。
$ dmidecode | grep -A 9 "System Information"
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.4 present.
Handle 0x0001, DMI type 1, 24 bytes
BIOS Information
Vendor: American Megatrends Inc.
Version: P1.60
Release Date: 08/21/2017
ROM Size: 16384 kB
Features:
PCI is supported
PC Card (PCMCIA) is supported
Boot from CD is supported
Selectable Boot is supported
EDD is supported
Print Screen Service is supported
USB Legacy is supported
BIOS boot specification 2.0 is supported
Function key-initiated network boot is supported
Targeted content distribution is supported
UEFI is supported
UEFI 2.3.1 is supported
ACPI is supported
EC Firmware Interface is supported
S3 Soft Off is supported
64-bit memory address is supported
Intel TXT is supported
UEFI Secure Boot is supported

GUI 工具

Linux 发行版通常还提供 GUI 工具来查看系统硬件信息。

System Monitor

System Monitor 是一款综合工具,可提供有关 CPU、内存、存储、网络和进程的实时信息。

HWInfo

HWInfo 是一款功能强大的硬件信息工具,可提供有关系统组件、传感器和健康状态的详细报告。

Hardinfo

Hardinfo 是一个命令行和 GUI 工具,为系统硬件生成详细报告。

常见问题

如何查看 CPU 温度?

可以使用 sensors 或 lm-sensors 命令来获取有关 CPU 温度的信息。
$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0: 48.0°C (high = 86.0°C, crit = 100.0°C)
Core 1: 47.0°C (high = 86.0°C, crit = 100.0°C)
Core 2: 46.0°C (high = 86.0°C, crit = 100.0°C)
Core 3: 45.0°C (high = 86.0°C, crit = 100.0°C)

如何查看硬盘信息?

可以使用 hdparm 或 smart

2025-02-05


上一篇:Linux 系统分发打包大全

下一篇:EFI 下的多系统 Linux 安装指南