> CentOS > CentOS入门 >

Linux系统查看硬件配置

以CentOS系统为例 
一、CPU 
cat /proc/cpuinfo 
如下是我的CPU信息,有4个信息,说明有4个逻辑CPU,但是每个physical id相同,说明只有1个物理CPU。 
1、多个逻辑CPU的”physical id”和”core id”均相同,说明开启了超线程。 
2、flags中有lm标记,说明是64位的CPU 
3、我的processor有4个不同的编号,并且同属于一个physical id,同时cpu cores 的值为1,这也就说明了我的CPU是单核心的,并且核心上有4个逻辑处理器。 
所以,我的机器CPU是Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz型号,1个64位物理CPU,单核4线程。

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 62
model name  : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping    : 4
microcode   : 1046
cpu MHz     : 2600.058
cache size  : 20480 KB
physical id : 12
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 12
initial apicid  : 12
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes f16c rdrand hypervisor lahf_lm ida arat pln pts dts fsgsbase erms
bogomips    : 5200.11
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 62
model name  : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping    : 4
microcode   : 1046
cpu MHz     : 2600.058
cache size  : 20480 KB
physical id : 12
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 12
initial apicid  : 12
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes f16c rdrand hypervisor lahf_lm ida arat pln pts dts fsgsbase erms
bogomips    : 5200.11
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 62
model name  : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping    : 4
microcode   : 1046
cpu MHz     : 2600.058
cache size  : 20480 KB
physical id : 12
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 12
initial apicid  : 12
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes f16c rdrand hypervisor lahf_lm ida arat pln pts dts fsgsbase erms
bogomips    : 5200.11
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 62
model name  : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping    : 4
microcode   : 1046
cpu MHz     : 2600.058
cache size  : 20480 KB
physical id : 12
siblings    : 1
core id     : 0
cpu cores   : 1
apicid      : 12
initial apicid  : 12
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes f16c rdrand hypervisor lahf_lm ida arat pln pts dts fsgsbase erms
bogomips    : 5200.11
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

二、内存  cat /proc/meminfo  如下是我的内存信息,总内存3.7G,剩余约380M

MemTotal:        3974056 kB
MemFree:          390724 kB
Buffers:           27460 kB
Cached:            98616 kB
SwapCached:        43080 kB
Active:          2634864 kB
Inactive:         692540 kB
Active(anon):    2584488 kB
Inactive(anon):   618872 kB
Active(file):      50376 kB
Inactive(file):    73668 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       3145724 kB
SwapFree:              0 kB
Dirty:                32 kB
Writeback:             0 kB
AnonPages:       3159036 kB
Mapped:            15320 kB
Shmem:              2032 kB
Slab:              97000 kB
SReclaimable:      18188 kB
SUnreclaim:        78812 kB
KernelStack:        4816 kB
PageTables:       101172 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     5132752 kB
Committed_AS:    9925672 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       18008 kB
VmallocChunk:   34359719108 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:     4194304 kB
DirectMap2M:           0 kB

三、硬盘  1、查看硬盘和分区  lsblk

NAME                        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvda                        202:0    0   30G  0 disk 
├─xvda1                     202:1    0  500M  0 part /boot
└─xvda2                     202:2    0 29.5G  0 part 
  ├─VolGroup-lv_root (dm-0) 253:0    0 26.5G  0 lvm  /
  └─VolGroup-lv_swap (dm-1) 253:1    0    3G  0 lvm  [SWAP]


(责任编辑:IT)