欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

Linux下查看CPU型号,内存大小,硬盘空间的命令(详解)

程序员文章站 2022-06-29 19:54:28
1 查看cpu 1.1 查看cpu个数 # cat /proc/cpuinfo | grep "physical id" | uniq | wc -l 2 **uni...

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查看内存条数》

查看原文:

 

# 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

以上就是小编为大家带来的linux下查看cpu型号,内存大小,硬盘空间的命令(详解)全部内容了,希望大家多多支持~