CPU info includes detailed information about the processor, like it's architecture, vendor name, model, number of cores, speed of each core etc. In Linux, there are many command line or GUI-based tools that can be used to show detailed information about your CPU hardware, however we are exploring some of the best and useful commands using which you can get much more detailed information about Linux CPU.
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.
$ 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
$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
Note: The number of processors shown by /proc/cpuinfo might be different from the actual number of cores on the processor. For example a processor with 2 cores and hyperthreading would be reported as a processor with 4 cores.
$ cat /proc/cpuinfo | grep 'core id' $ cat /proc/cpuinfo | grep 'core id'| wc -l 32
If you’re interested in just knowing the CPU vendor, go with cat /proc/cpuinfo along with with the grep command.
$ cat /proc/cpuinfo | grep vendor | uniq
vendor_id : GenuineIntel
$ cat /proc/cpuinfo | grep 'model name' | uniq
model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
Hardinfo is a gtk based gui utility that generates reports about various hardware components including memory, storage, PCI devices, storage, USB devices etc plus information on the OS, kernel, and networking. But it can also run from the command line only if there is no gui display available.
If hardinfo is not installed on your Linux box, you can do so with the following command on your Ubuntu system.
$ sudo apt-get install hardinfo
$ hardinfo | less
It would produce a large report about many hardware parts, by reading files from the /proc directory. The cpu information is towards the beginning of the report. The report can also be written to a text file. Hardinfo also performs a few benchmark tests taking a few minutes before the report is displayed.
The nproc command just prints out the number of processing units available. Note that the number of processing units might not always be the same as number of cores.
$ nproc 4
$ uname -a
Linux 2.6.39-400.215.10.el5uek #1 SMP Tue Sep 10 22:51:46 PDT 2014 x86_64 x86_64 x86_64 GNU/Linux
One of my all time favorite command line tools and I have it running on all my Linux systems. This is an excellent script that provides information in an easy to understand format.
$ sudo apt-get install inxi
$ sudo yum install inxi
$ inxi -C
# dmidecode -t 4 # dmidecode 2.9 $sudo demidecode -t processor $ sudo dmidecode -t 4
Get BIOS information using dmidecode
# dmidecode -t bios # dmidecode 2.9View Manufacturer, Model and Serial number of the equipment using dmidecode
# dmidecode -t system # dmidecode 2.9
The cpuid command fetches CPUID information about Intel and AMD x86 processors.
$ sudo apt-get install cpuid
$ sudo yum install cpuid
$ 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