How to find out CPU information on CentOS Linux 7.x

last updated in Categories , ,

I am a new CentOS Linux 7.x sysadmin and user. How do I find out information about my CPU like the number of cores, sockets, CPU type, make and other features provided by ARM, Intel, and AMD CPUs using the command line options on CentOS Linux 5.x/6.x/7.x?

CPU is an acronym for the central processing unit. It is an essential part of your desktop or server. The CPU controls the other parts of the computer by sending or reading instructions. Your CPU reads the list of instructions from a computer program. Most CPUs used in RHEL servers or desktops/ laptops made by either AMD or Intel. But you may have a server that is powered by IBM, ARM and other CPUs too. Hence, it is vital to find out information about your CPU on CentOS Linux.

NOTE: Please note that [root@centos7-box ~]# is my shell prompt on CentOS Linux. You need to type commands after the SHELL prompt.

Find out CPU information on CentOS Linux 7.x

To find information about the CPU architecture of CentOS Linux based system, run:
[root@centos7-box ~]# lscpu
Sample outputs:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 71
Model name:            Intel(R) Xeon(R) CPU E3-1285L v4 @ 3.40GHz
Stepping:              1
CPU MHz:               3796.154
CPU max MHz:           3800.0000
CPU min MHz:           800.0000
BogoMIPS:              6784.29
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              6144K
L4 cache:              131072K
NUMA node0 CPU(s):     0-7
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 pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb intel_pt ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt dtherm ida arat pln pts spec_ctrl intel_stibp flush_l1d

CentOS Linux display CPU information

Another option is to type cat command:
[root@centos7-box ~]# cat /proc/cpuinfo
Find out CPU information on CentOS Linux

CentOS Linux show information about my CPU

Let us find out number of physical CPUs in your CentOS Linux server, run:
[root@centos7-box ~]# grep physical.id /proc/cpuinfo | sort -u | wc -l
List number of cores per CPU for CentOS enterprise Linux 7.x/6.x:
[root@centos7-box ~]# grep cpu.cores /proc/cpuinfo | sort -u
Finally, let us print number of logical processors for CentOS Linux:
[root@centos7-box ~]# grep processor /proc/cpuinfo | wc -l
Another option is to run dmidecode command:
[root@centos7-box ~]# dmidecode -t4
Getting CentOS cpu info using command line

How to determine number of CPU sockets on my CentOS Linux 7.x

Use the grep command along with wc command and sort command as follows:
[root@centos7-box ~]# grep physical.id /proc/cpuinfo | sort -u | wc -l
OR use the lscpu command:
[root@centos7-box ~]# lscpu | grep -i "socket(s)"

CentOS linux determine number of CPU sockets on a system
CentOS Linux determine number of CPU sockets on my server or desktop

Conclusion

This page explained how to find out CPUs, sockets and other information on CentOS Linux using the command line. For more information please see this URL.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

1 comment

    Still, have a question? Get help on our forum!