歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> linux查看硬件相關信息

linux查看硬件相關信息

日期:2017/3/1 13:51:20   编辑:關於Linux
一、 CPU相關
1. CPU的硬件信息
[@125 opt]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 45
model name : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping : 7
cpu MHz : 2000.062
cache size : 20480 KB
physical id : 0
siblings : 16
core id : 0
cpu cores : 8
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 acpi mmx fxsr sse sse2 ss ht tm syscall nx pdpe1gb rdtscp lm constant_tsc
ida nonstop_tsc arat pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm
bogomips : 4000.12
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management: [8]


二、 內存相關
1. 內存硬件信息
[@125 opt]# cat /proc/meminfo
MemTotal: 32915200 kB
MemFree: 10768212 kB
Buffers: 318444 kB
Cached: 19147620 kB
SwapCached: 368 kB
Active: 2555992 kB
Inactive: 18833328 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 32915200 kB
LowFree: 10768212 kB
SwapTotal: 8385920 kB
SwapFree: 8385552 kB
Dirty: 7860 kB
Writeback: 0 kB
AnonPages: 1923272 kB
Mapped: 23200 kB
Slab: 703024 kB
PageTables: 8896 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 24843520 kB
Committed_AS: 2439540 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 271820 kB
VmallocChunk: 34359464951 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 2048 kB

2. 內存使用情況 free
[@125 opt]# free
total used free shared buffers cached
Mem: 32915200 3673460 29241740 0 256348 888828
-/+ buffers/cache: 2528284 30386916
Swap: 8385920 0 8385920

三、 硬盤相關
[@ltv_125 opt]# df -h -T
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda1 ext3 3.9G 542M 3.2G 15% /
/dev/sda6 ext3 791G 20G 730G 3% /opt
/dev/sda3 ext3 3.9G 651M 3.1G 18% /var
/dev/sda5 ext3 4.9G 2.2G 2.5G 47% /usr
tmpfs tmpfs 16G 40K 16G 1% /dev/shm


四、查看開機啟動消息
[@ltv_125 rec_multiudp_to_file]# dmesg
Linux version 2.6.18-274.el5 (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Fri Jul 8 17:36:59 EDT 2011
Command line: ro root=LABEL=/
BIOS-provided physical RAM map:
BIOS-e820: 0000000000010000 - 000000000009c000 (usable)
BIOS-e820: 0000000000100000 - 00000000cd2f0000 (usable)
BIOS-e820: 00000000cd2f0000 - 00000000cd31c000 (reserved)
BIOS-e820: 00000000cd31c000 - 00000000cd35b000 (ACPI data)
BIOS-e820: 00000000cd35b000 - 00000000d0000000 (reserved)
BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
BIOS-e820: 00000000fe000000 - 0000000100000000 (reserved)
BIOS-e820: 0000000100000000 - 0000000830000000 (usable)

五、芯片信息
1. $ lspci -v


2. $ dmidecode
Dmidecode 這款軟件允許你在 Linux 系統下獲取有關硬件方面的信息。
Dmidecode 遵循 SMBIOS/DMI 標准,其輸出的信息包括 BIOS、系統、主板、處理器、內存、緩存等等

Usage: dmidecode [OPTIONS]
Options are:
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)
從設備文件讀信息,輸出內容與不加參數標准輸出相同

-h, --help Display this help text and exit
顯示幫助信息

-q, --quiet Less verbose output
顯示更少的簡化信息

-s, --string KEYWORD Only display the value of the given DMI string
只顯示指定DMI字符串的信息

-t, --type TYPE Only display the entries of given type
只顯示指定條目的信息

-u, --dump Do not decode the entries
顯示未解碼的原始條目內容
--dump-bin FILE Dump the DMI data to a binary file
--from-dump FILE Read the DMI data from a binary file
-V, --version Display the version and exit

?顯示版本信息
2.1 dmidecode參數string及type列表
(1)Valid string keywords are:
bios-vendor
bios-version
bios-release-date
system-manufacturer
system-product-name
system-version
system-serial-number
system-uuid
baseboard-manufacturer
baseboard-product-name
baseboard-version
baseboard-serial-number
baseboard-asset-tag
chassis-manufacturer
chassis-type
chassis-version
chassis-serial-number
chassis-asset-tag
processor-family
processor-manufacturer
processor-version
processor-frequency
(2)Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
Cache
connector
slot
(3)type全部編碼列表
0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9 System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply
40 Additional Information
41 Onboard Device


2.2 命令用法示例
查看服務器型號:dmidecode | grep 'Product Name'
查看主板的序列號:dmidecode |grep 'Serial Number'
查看系統序列號:dmidecode -s system-serial-number
查看內存信息:dmidecode -t memory
查看OEM信息:dmidecode -t 11

關於 Dmidecode 的更多用法,你可以通過指定 -h 選項查詢
不帶選項執行 dmidecode 通常會輸出所有的硬件信息。

Dmidecode 有個很有用的選項 -t,可以按指定類型輸出相關信息,
假如要獲得處理器方面的信息,
則可以執行:
$ dmidecode -t processor
Copyright © Linux教程網 All Rights Reserved