How To Get CPU (Central Processing Unit) Info and Number of CPU’s In Linux?

CPU is central part of the computer systems.  They provide all logic and computation power to the operating system that runs on them. In general we look the frequency and brand of the CPU like i5,i7. There are very different features in detail in CPU’s. There are different commands to get CPU’s information like flags, instruction, product name etc. But most compatible CPU information source is /proc/cpuinfo

Getting Information From /proc/cpuinfo

$ more /proc/cpuinfo
Getting Information From /proc/cpuinfo
Getting Information From /proc/cpuinfo
  • From vendor_id we can understand that this CPU is Intel
  • model name is inside model name of Intel for this CPU
  • cpu MHz specifies frequency or speed of this CPU
  • we can see from flags those instruction sets supported by this CPU
  • processor line specifies CPU index. In this case we have only one core which index is 0
  • cache_alignment shows the architecture of CPU like 32 or 64 bit.

Getting Cpu Information With lscpu

Alternative to cpuinfo is lscpu which proved more understandable information about CPU like below. We do not provide any option for the current usage.

$ lscpu
Getting Cpu Information With lscpu
Getting Cpu Information With lscpu

Following information about the CPU is provided with lscpu command.

  • `Architecture` displays the 32 or 64 bit of the CPU
  • `CPU op-mode` display which architectures the CPU can handle
  • `Byte Order` is the byte order of the CPU instructions
  • `CPU` is CPU cunt
  • `Threads Per Core` is how many threads are supported per core
  • `Cores per Socket` is how many cores are per socket
  • `Model name` shows CPU model number in detail
  • `CPU MHz` shows the speed or frequency of the CPU
  • `Virtualization type` shows which type of virtualization is supported
  • `L1,L2,L3 cache` shows CPU cache size
  • `Flag` show the instruction set supported by CPU.

 

How To Get CPU (Central Processing Unit) Info and Number of CPU’s In Linux? Infografic

How To Get CPU (Central Processing Unit) Info and Number of CPU’s In Linux? Infografic
How To Get CPU (Central Processing Unit) Info and Number of CPU’s In Linux? Infografic

Leave a Comment