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.
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
$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.
To get the actual number of cores, check the core id for unique values
$ cat /proc/cpuinfo | grep 'core id' $ cat /proc/cpuinfo | grep 'core id'| wc -l 32
lscpu
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
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
To Find Model Name
$ cat /proc/cpuinfo | grep 'model name' | uniq
model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
Hardinfo
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.
To install hardinfo
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.
To find the number of processing units available
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
To Display name of the Operating System.
$ 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
Inxi
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.
To install Inix on Ubuntu
$ sudo apt-get install inxi
To install Inix on CentOS/Fedora
$ sudo yum install inxi
Print out cpu/processor related information
$ inxi -C
dmidecode
# 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
cpuid
The cpuid command fetches CPUID information about Intel and AMD x86 processors.
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
No comments:
Post a Comment