Linux /proc/cpuinfo file contains details about individual cpu cores. Proc (/proc) file system provides information about CPU and their speed which is a pseudo-filesystem. It is used as an interface to kernel data structures. It is commonly mounted at /proc. You can use command like more, less or grep to see the contents of this file.
Commands to Get CPU Details on Linux
$ less /proc/cpuinfo
siblings : 16
core id : 0
cpu cores : 8
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
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 pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips : 5199.62
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
................ etc
You can also get details using more and cat command like:
$ more /proc/cpuinfo
$ cat /proc/cpuinfo
To display number of processors in the system
Every processor or core is listed separately and the various details about speed, cache size and model name are included in the description. To count the number of processing units use grep command with wc.
$cat /proc/cpuinfo | grep processor | wc -l
32
$ grep processor /proc/cpuinfo
processor : 0
processor : 1
processor : 2
processor : 3
processor : 4
processor : 5
processor : 6
processor : 7
processor : 8
........... ...........
processor : 29
processor : 30
processor : 31
$ cat /proc/cpuinfo | grep 'core id'
$ cat /proc/cpuinfo | grep 'core id'| wc -l
32
lscpu is a small and quick command that does not need any options. It would simply print the cpu hardware details in a human readable format.
$ lscpu
To Find CPU vendor
$ cat /proc/cpuinfo | grep vendor | uniq
$ cat /proc/cpuinfo | grep 'model name' | uniq
$ sudo apt-get install hardinfo
Let’s Look into this command
$ hardinfo | less
$ nproc
4
$ uname -a
$ sudo apt-get install inxi
To install Inix on CentOS/Fedora
$ sudo yum install inxi
Print out cpu/processor related information
$ inxi -C
dmidecode
The dmidecode command displays some information about the cpu, which includes the socket type, vendor name and various flags. Following command with type id 4 will get the information about CPU of the system.
# dmidecode -t 4
# dmidecode 2.9
$sudo demidecode -t processor
$ sudo dmidecode -t 4
# dmidecode -t bios
# dmidecode 2.9
View Manufacturer, Model and Serial number of the equipment using dmidecode
# dmidecode -t system
# dmidecode 2.9
cpuid
This program can be installed with apt on ubuntu
$ sudo apt-get install cpuid
To install cpuid on Fedora and CentOS distributions.
$ sudo yum install cpuid
And here is sample output
$ cpuid
Run the command with less to get a readable output.
$ cpuid | less
You can also do R&D with grep command to find more cpu info in Linux/Unix. From the readers, your comment is valuable to us. Please share if you have more valuable commands to get more detailed output.
Other similar sources:
nixCraft: Number of CPUs and Their Speed
redhax: /proc/cpuinfo.html
linuxquestions.org