Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux 硬體資訊查看指令大全:CPU、記憶體、磁碟、網卡一網打盡

編輯:關於 Linux

Linux 系統主要透過指令查看硬體資訊,不像 Windows 那麼直觀。本文整理了查看 CPU、記憶體、磁碟、網卡、PCI 裝置、BIOS 等關鍵硬體資訊的實用指令,並附上實際輸出範例,方便系統管理員快速診斷硬體狀態。

CPU 資訊查看

lscpu - 統計資訊概覽

$ lscpu
Architecture:        i686
CPU op-mode(s):      32-bit, 64-bit
CPU(s):              4
Thread(s) per core:  1
Core(s) per socket:  4
Vendor ID:           GenuineIntel
Model name:          Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz
Virtualization:      VT-x
L3 cache:            6144K

/proc/cpuinfo - 詳細核心資訊

$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
model name	: Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz
cpu MHz		: 1600.000
cache size	: 6144 KB
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 syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid

記憶體資訊查看

free -m - 快速查看使用量

$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3926        3651         274           0          12         404
Swap:          9536          31        9505

/proc/meminfo - 詳細記憶體統計

$ cat /proc/meminfo
MemTotal:        4020868 kB
MemFree:          230884 kB
Buffers:            7600 kB
Cached:           454772 kB
SwapTotal:       9765888 kB
SwapFree:        9734524 kB

dmidecode -t memory - 實體記憶體插槽資訊

# dmidecode -t memory
Handle 0x0008, DMI type 16, 23 bytes
Physical Memory Array
    Location: System Board Or Motherboard
    Maximum Capacity: 32 GB

Handle 0x000A, DMI type 17, 34 bytes
Memory Device
    Size: 4096 MB
    Type: DDR3
    Speed: 1600 MHz

磁碟與分割區資訊

lsblk - 樹狀顯示裝置結構

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk
├─sda1   8:1    0     1G  0 part /boot
├─sda2   8:2    0   9.3G  0 part [SWAP]
├─sda3   8:3    0  74.5G  0 part /
└─sda5   8:5    0 111.8G  0 part /home

fdisk -l - 詳細分割表資訊

# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2148351     1073152   83  Linux
/dev/sda2         2148352    21680127     9765888   82  Linux swap
/dev/sda3        21680128   177930239    78125056   83  Linux

網卡資訊查看

lspci | grep -i eth - 硬體層級網卡資訊

# lspci | grep -i eth
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

ip link show / ifconfig -a - 網路介面狀態

# ip link show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN
2: eth0:  mtu 1500 qdisc pfifo_fast state UP qlen 1000

ethtool eth0 - 詳細連線參數

# ethtool eth0
Speed: 1000Mb/s
Duplex: Full
Link detected: yes
Auto-negotiation: on

PCI 裝置與 BIOS 資訊

lspci - 所有 PCI 裝置列表

# lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller
00:1b.0 Audio device: Intel Corporation Panther Point High Definition Audio Controller
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller

dmidecode -t bios - BIOS 版本資訊

# dmidecode -t bios
BIOS Information
    Vendor: American Megatrends Inc.
    Version: 4.6.5
    Release Date: 04/25/2012

dmidecode -q - 快速查看所有 DMI 資訊

善用上述指令組合,即可全面掌握 Linux 系統硬體配置,無論是伺服器上架驗收、效能調校或故障排查都能得心應手。

Copyright © Windows教程網 All Rights Reserved