How to check CPU details on Linux

Posted at October 28, 2016 at 4:23 pm by Jithin

 

Processor/CPU details

It is important to know the details about the processor and the specification of the system used. In this topic we will be covering how to get the details regarding number of cores, availability of hyper threading, architecture, cache size etc. It is not possible to get all the information in one command, so we will be going through some of the commonly used commands for getting details regarding the processor/CPU (Central Processing Unit)

1) Vendor and model of the processor

The details of processor’s vendor and model name can be find in /proc/cpuinfo file with the help of grep command.

cat /proc/cpuinfo | grep vendor | uniq

vendor_id: Genuine Intel

The following command can be followed to get the model name of the processor.

 cat /proc/cpuinfo | grep ‘model name’ | uniq

model name: Intel Xeon E312xx (Sandy Bridge)

2) Architecture

The lscpu command provides the architecture details of the processor

Architecture:                x86_64

CPU op-mode(s):         32-bit, 64-bit

Byte Order:                 Little Endian

———-

The architecture x86_64 indicates that it is a 64 bit processor.

3) Frequency

The information regarding frequency of the processor is available in both the lcpu and /proc/cpuinfo

It is to be noted that the frequency displayed in the output cannot be actual frequency, because the cpu tries to not use all of its power. They only consume more power or use higher frequency during the time of high load.

$ lscpu | grep -i mhz

CPU MHz:               3300.014

$ cat /proc/cpuinfo | grep -i mhz | uniq

cpu MHz         : 3300.014

If you wish to monitor the change in the frequency, then follow the given command:

$ watch -n 0.1 “cat /proc/cpuinfo | grep -i mhz”

The output of the above command gives an updated information regarding the frequency consumption of the processor.

Every 0.1s: cat /proc/cpuinfo | grep -i mhz                                                              Thu Oct 13 10:20:32 2016

cpu MHz         : 3300.014

cpu MHz         : 3300.014

cpu MHz         : 3300.014

4) Number of cores

This number indicates the separate number of the CPU (Central Processing Unit). The higher the number of cores, more  multi-tasking can be achieved. That is more than one program can be executed at a time thereby enhancing the speed of the processor.

The lscpu commands provides the details regarding the “cores per socket”.

 $ lscpu

Architecture:                x86_64

CPU op-mode(s):        32-bit, 64-bit

Byte Order:                   Little Endian

CPU(s):                         2

On-line CPU(s) list:      0

Thread(s) per core:        1

Core(s) per socket:        2

Socket(s):                      1

We also know that /proc/cpuinfo file also provides details regarding the number of cores in the processor.

It won’t be a wise decision to completely rely on counting the number of processors.

$ cat /proc/cpuinfo | grep ‘processor’

processor: 0

Some processors may come under the category of hyper thread processors where the operating system considers the number of cores as double. Where the actual reality is one. Whereas /proc/cpuinfo has an information regarding the “core id”. This is a unique id for each processor. By counting the number of “core id” it will give an actual report reading the number of cores.

$ cat /proc/cpuinfo | grep -i ‘core id’

core id: 0

Also there are processors which comes under the category of multiple processors. This means that the system contains more than one physical processors. It is seen that a system contains more than one processors attached in a motherboard. In those cases, the output of the /proc/cpuinfo will be different. The “physical id” values will have more than one value in the case of multiple processor.

$ cat /proc/cpuinfo | grep -i ‘physical id’ | uniq

physical id: 0

It is to be noted that if the output of the above command gives you more than one physical id then just know the fact that the system contains multiple physical processors.

 

5) Hyper threading

Intel introduced a technology called Hyper Threading where it permits each core to act like 2 logical processing units. This technology built to meet one and only goal and that is speed. Which will cause an increase in the power of processing units of each core up to a limit. For confirming whether the processor has hyper thread technology embedded in it, we have to go through some numbers in the of logical processing units and actual number of cores.

The method for the final decision making is by checking the number of processing units is equal to the number of cores, if so then we can come to the conclusion that it has no hyper threading technology. If the number of processing units is more or twice the number of cores then push the button.

If you need any further assistance please contact our support department.

1.00 avg. rating (48% score) - 1 vote

You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply