Linux下查看CPU型号,内存大小,硬盘空间的命令(详解)
程序员文章站
2022-08-12 14:40:23
感谢有奉献精神的人 转自:http://www.jb51.net/article/97157.htm 1 查看CPU 1.1 查看CPU个数 # cat /proc/cpuinfo | grep "physical id" | uniq | wc -l 2 **uniq命令:删除重复行;wc –l命 ......
感谢有奉献精神的人
转自:http://www.jb51.net/article/97157.htm
1 查看cpu
1.1 查看cpu个数
# cat /proc/cpuinfo | grep "physical id" | uniq | wc -l
2 **uniq命令:删除重复行;wc –l命令:统计行数**
1.2 查看cpu核数
# cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores : 4
1.3 查看cpu型号
# cat /proc/cpuinfo | grep 'model name' |uniq
model name : intel(r) xeon(r) cpu e5630 @ 2.53ghz
总结:该服务器有2个4核cpu,型号intel(r) xeon(r) cpu e5630 @ 2.53ghz
2 查看内存
2.1 查看内存总数
#cat /proc/meminfo | grep memtotal
memtotal: 32941268 kb //内存32g
2.2 查看内存条数
本节内容引自新浪博文《linux查看内存条数》
查看原文:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# dmidecode |grep -a16 "memory device$" memory device array handle: 0x1000 error information handle: not provided total width: 72 bits data width: 64 bits size: 2048 mb //1条2g内存 form factor: dimm set: 1 locator: dimm1 bank locator: not specified type: ddr2 type detail: synchronous speed: 667 mhz manufacturer: 7f7f7f7f7f510000 serial number: 0403e324 asset tag: 450721 part number: 72t256220hr3sa -- memory device array handle: 0x1000 error information handle: not provided total width: 72 bits data width: 64 bits size: 2048 mb //1条2g内存 form factor: dimm set: 1 locator: dimm2 bank locator: not specified type: ddr2 type detail: synchronous speed: 667 mhz manufacturer: 7f7f7f7f7f510000 serial number: 0403e324 asset tag: 450721 part number: 72t256220hr3sa -- memory device array handle: 0x1000 error information handle: not provided total width: 72 bits data width: 64 bits size: no module installed //1个内存空槽 form factor: dimm set: 2 locator: dimm3 bank locator: not specified type: ddr2 type detail: synchronous speed: unknown manufacturer: serial number: asset tag: part number: -- memory device array handle: 0x1000 error information handle: not provided total width: 72 bits data width: 64 bits size: no module installed //1个内存空槽 form factor: dimm set: 2 locator: dimm4 bank locator: not specified type: ddr2 type detail: synchronous speed: unknown manufacturer: serial number: asset tag: part number: -- memory device array handle: 0x1000 error information handle: not provided total width: 72 bits data width: 64 bits size: no module installed //1个内存空槽 form factor: dimm set: 3 locator: dimm5 bank locator: not specified type: ddr2 type detail: synchronous speed: unknown manufacturer: serial number: asset tag: part number: -- memory device array handle: 0x1000 error information handle: not provided total width: 72 bits data width: 64 bits size: no module installed //1个内存空槽 form factor: dimm set: 3 locator: dimm6 bank locator: not specified type: ddr2 type detail: synchronous speed: unknown manufacturer: serial number: asset tag: part number: |
总结:该服务器有两条2g内存 ,空余4个插槽
3 查看硬盘
3.1 查看硬盘大小
# fdisk -l | grep disk
disk /dev/cciss/c0d0: 146.7 gb, 146778685440 bytes
总结:硬盘大小146.7g,即厂商标称的160g