当前位置:文档之家› 在linux下查看硬件信息

在linux下查看硬件信息

查看cpu:

通过/proc文件系统
[root@server14 ~]# cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 10
model name : AMD Athlon(tm) XP 2600+
stepping : 0
cpu MHz : 1921.473
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 mmx fxsr sse pni syscall mmxext 3dnowext 3dnow
bogomips : 3844.80

通过查看开机信息,dmesg会打印出所有的启动信息
[root@server14 ~]# dmesg | grep -i 'cpu'
Initializing CPU#0
CPU 0 irqstacks, hard=c0409000 soft=c0408000
CPU: After generic identify, caps: 0383fbff c1c3fbff 00000000 00000000
CPU: After vendor identify, caps: 0383fbff c1c3fbff 00000000 00000000
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 512K (64 bytes/line)
CPU: After all inits, caps: 0383f3ff c1c3fbff 00000000 00000420
Intel machine check reporting enabled on CPU#0.
CPU: AMD Athlon(tm) XP 2600+ stepping 00
ACPI: Processor [CPU0] (supports C1)

[root@server14 ~]# arch
i686

[root@server14 ~]# uname -p
athlon

查看cpu温度:

[root@server14 ~]# cat /proc/acpi/thermal_zone/THRM/temperature
temperature: 36 C
需要内核相关模块(比如I2C)支持,找出系统的传感器型号,然后在内核中打开相应选项。

查看cpu使用情况:

[root@server14 ~]# top

top - 14:17:56 up 1:32, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 43 total, 1 running, 42 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0% us, 0.0% sy, 0.0% ni, 99.7% id, 0.0% wa, 0.3% hi, 0.0% si
Mem: 3116220k total, 83020k used, 3033200k free, 10140k buffers
Swap: 2096472k total, 0k used, 2096472k free, 41376k cached

[root@server14 ~]# uptime
14:18:36 up 1:33, 1 user, load average: 0.00, 0.00, 0.00

查看内存:

[root@server14 ~]# cat /proc/meminfo
MemTotal: 3116220 kB
MemFree: 3033712 kB
Buffers: 9960 kB
Cached: 41224 kB
SwapCached: 0 kB
Active: 28868 kB
Inactive: 28992 kB
HighTotal: 2228160 kB
HighFree: 2177344 kB
LowTotal: 888060 kB
LowFree: 856368 kB
SwapTotal: 2096472 kB
SwapFree: 2096472 kB
Dirty: 12 kB
Writeback: 0 kB
Mapped: 11880 kB
Slab: 12296 kB
CommitLimit: 3654580 kB
Committed_AS: 40836 kB
PageTables: 640 kB
VmallocTotal: 106488 kB
VmallocUsed: 2296 kB
VmallocChunk: 103684 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 4096 kB

[root@server14 ~]# dmesg | grep mem
Memory: 3114820k/3145664k available (2169k kernel code, 29808k reserved, 725k data, 172k init, 2228160k highmem)
Freeing initrd memory: 57

8k freed
highmem bounce pool size: 64 pages
Total HugeTLB memory allocated, 0
agpgart: Maximum main memory to use for agp memory: 2925M
Freeing unused kernel memory: 172k freed

[root@server14 ~]# dmidecode | grep -i mem
MTRR (Memory type range registers)
Memory Controller Information
Maximum Memory Module Size: 1024 MB
Maximum Total Memory Size: 3072 MB
Supported Memory Types:
Memory Module Voltage: 2.9 V
Associated Memory Slots: 3
Memory Module Information
Memory Module Information
Memory Module Information
Physical Memory Array
Use: System Memory
Memory Device
Memory Device
Memory Device
Memory Array Mapped Address
Memory Device Mapped Address
Memory Array Mapped Address Handle: 0x001F
Memory Device Mapped Address
Memory Array Mapped Address Handle: 0x001F
Memory Device Mapped Address
Memory Array Mapped Address Handle: 0x001F

查看内存使用情况:

[root@server14 ~]# free -m
total used free shared buffers cached
Mem: 3043 80 2962 0 9 40
-/+ buffers/cache: 30 3012
Swap: 2047 0 2047

[root@server14 ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 0 0 3033584 10000 41244 0 0 9 4 1110 17 0 0 99 0

查看硬盘:

[root@server14 ~]# fdisk -l

Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 274 2096482+ 82 Linux swap
/dev/hda3 275 9964 77834925 83 Linux

Disk /dev/hdb: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 9964 80035798+ 83 Linux

[root@server14 ~]# df -h -T
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda3 ext3 74G 778M 69G 2% /
/dev/hda1 ext3 99M 8.7M 86M 10% /boot
none tmpfs 1.5G 0 1.5G 0% /dev/shm
/dev/hdb1 ext3 76G 85M 72G 1% /home

查看网卡:

[root@server14 ~]# dmesg | grep -i 'eth'
divert: not allocating divert_blk for non-ethernet device lo
forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.60.
divert: allocating divert_blk for eth0
eth0: forcedeth.c: subsystem: 0147b:1c02 bound to 0000:00:04.

0
divert: not allocating divert_blk for non-ethernet device sit0
eth0: no IPv6 routers present

[root@server14 ~]# cat /etc/sysconfig/hwconf | grep -i eth
device: eth0
driver: forcedeth
desc: "nVidia Corporation nForce2 Ethernet Controller"

[root@server14 ~]# lspci | grep -i 'eth'
00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet Controller (rev a1)

查看显卡:

[root@server14 ~]# lspci |grep -i 'VGA'
01:09.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27)

[root@server14 ~]# dmesg | grep -i 'VGA'
Console: colour VGA+ 80x25

查看中断请求:

[root@server14 ~]# cat /proc/interrupts
CPU0
0: 6209204 IO-APIC-edge timer
8: 1 IO-APIC-edge rtc
9: 0 IO-APIC-level acpi
14: 4672 IO-APIC-edge ide0
15: 53742 IO-APIC-edge ide1
185: 623474 IO-APIC-level eth0
NMI: 0
LOC: 6208643
ERR: 0
MIS: 0

综合查看:

读出计算机的标识号,只对正规品牌的机器有效,如DELL、HP之类
[root@server14 ~]# dmidecode | grep -i 'serial number'
Serial Number:
Serial Number:
Serial Number:

[root@server14 ~]# cat /proc/pci
PCI devices found:
Bus 0, device 0, function 0:
Class 0600: PCI device 10de:01e0 (rev 193).
Prefetchable 32 bit memory at 0xe0000000 [0xe1ffffff].
Bus 0, device 0, function 1:
Class 0500: PCI device 10de:01eb (rev 193).
Bus 0, device 0, function 2:
Class 0500: PCI device 10de:01ee (rev 193).
Bus 0, device 0, function 3:
Class 0500: PCI device 10de:01ed (rev 193).
Bus 0, device 0, function 4:
Class 0500: PCI device 10de:01ec (rev 193).
Bus 0, device 0, function 5:
Class 0500: PCI device 10de:01ef (rev 193).
Bus 0, device 1, function 0:
Class 0601: PCI device 10de:0060 (rev 164).
Bus 0, device 1, function 1:

查看所有启动时检测到的硬件信息
[root@server14 ~]# dmesg
Linux version 2.6.9-67.EL (mockbuild@https://www.doczj.com/doc/d015368174.html,) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 Fri Nov 16 12:34:13 EST 2007
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 00000000bfff0000 (usable)
BIOS-e820: 00000000bfff0000 - 00000000bfff3000 (ACPI NVS)
BIOS-e820: 00000000bfff3000 - 00000000c0000000 (ACPI data)
BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
2175MB HIGHMEM available.
896MB LOWMEM available.
Using x86 segment limits to approximate NX protection
zapping low mappings.
On node 0 totalpages: 786416
DMA zone: 4096 pages, LIFO batch:1
Normal zone: 225280 pages

, LIFO batch:16
HighMem zone: 557040 pages, LIFO batch:16

显示外设信息, 如usb,网卡等信息
[root@server14 ~]# lspci
00:00.0 Host bridge: nVidia Corporation nForce2 AGP (different version?) (rev c1)
00:00.1 RAM memory: nVidia Corporation nForce2 Memory Controller 1 (rev c1)
00:00.2 RAM memory: nVidia Corporation nForce2 Memory Controller 4 (rev c1)
00:00.3 RAM memory: nVidia Corporation nForce2 Memory Controller 3 (rev c1)
00:00.4 RAM memory: nVidia Corporation nForce2 Memory Controller 2 (rev c1)
00:00.5 RAM memory: nVidia Corporation nForce2 Memory Controller 5 (rev c1)
00:01.0 ISA bridge: nVidia Corporation nForce2 ISA Bridge (rev a4)
00:01.1 SMBus: nVidia Corporation nForce2 SMBus (MCP) (rev a2)
00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet Controller (rev a1)
00:08.0 PCI bridge: nVidia Corporation nForce2 External PCI Bridge (rev a3)
00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2)
00:1e.0 PCI bridge: nVidia Corporation nForce2 AGP (rev c1)
01:09.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27)

[root@server14 ~]# lspci -v
00:00.0 Host bridge: nVidia Corporation nForce2 AGP (different version?) (rev c1)
Subsystem: ABIT Computer Corp.: Unknown device 1c02
Flags: bus master, 66Mhz, fast devsel, latency 0
Memory at e0000000 (32-bit, prefetchable) [size=32M]
Capabilities: [40] AGP version 2.0
Capabilities: [60] HyperTransport: Host or Secondary Interface

00:00.1 RAM memory: nVidia Corporation nForce2 Memory Controller 1 (rev c1)
Subsystem: nVidia Corporation: Unknown device 0c17
Flags: 66Mhz, fast devsel

[root@server14 ~]# cat /etc/sysconfig/hwconf
-
class: OTHER
bus: PCI
detached: 0
driver: unknown
desc: "nVidia Corporation nForce2 AGP"
vendorId: 10de
deviceId: 01e8
subVendorId: 0000
subDeviceId: 0000
pciType: 1
pcidom: 0
pcibus: 0
pcidev: 1e
pcifn: 0


全面的显示系统的信息, 包括bios、cpu、内存
[root@server14 ~]# dmidecode
# dmidecode 2.2
SMBIOS 2.2 present.
37 structures occupying 981 bytes.
Table at 0x000F0800.
Handle 0x0000
DMI type 0, 19 bytes.
BIOS Information
Vendor: Phoenix Technologies, LTD
Version: 6.00 PG
Release Date: 11/22/2004
Address: 0xE0000
Runtime Size: 128 kB
ROM Size: 512 kB
Characteristics:
ISA is supported
PCI is supported
PNP is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed
EDD is supported

5.25"/360 KB floppy services are supported (int 13h)
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)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
AGP is supported
LS-120 boot is supported
ATAPI Zip drive boot is supported

[root@server14 ~]# dmidecode | less
# dmidecode 2.2
SMBIOS 2.2 present.
37 structures occupying 981 bytes.
Table at 0x000F0800.
Handle 0x0000
DMI type 0, 19 bytes.
BIOS Information
Vendor: Phoenix Technologies, LTD
Version: 6.00 PG
Release Date: 11/22/2004
Address: 0xE0000
Runtime Size: 128 kB
ROM Size: 512 kB
Characteristics:

相关主题
文本预览
相关文档 最新文档