How to see cpu parameters on linux VPS

1. Get CPU information using cpuinfo library

The CPU information can be viewed by looking at the contents of the / proc / cpuinfo file with the following command:

$ cat /proc/cpuinfo

Linux CPU Information
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 69
model name : Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz
stepping : 1
microcode : 0x1c
cpu MHz : 1700.062
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
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 eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts
bugs :
bogomips : 4788.92
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:

Getting specific information can be combined with the grep command. For example, want to get information of vendor, model, number of CPUs, number of cores ...:

$ cat /proc/cpuinfo | grep 'vendor' | uniq		# Hiển thị nhà cung cấp
$ cat /proc/cpuinfo | grep 'model name' | uniq # Hiển thị model CPU
$ cat /proc/cpuinfo | grep processor | wc -l # Hiển thị số lượng core CPU.



2. The cpuid command

Installation on centos:

yum install cpuid -y

apt-get install cpuid

$ cpuid

CPU 0:
vendor_id = "GenuineIntel"
version information (1/eax):
processor type = primary processor (0)
family = Intel Pentium Pro/II/III/Celeron/Core/Core 2/Atom, AMD Athlon/Duron, Cyrix M2, VIA C3 (6)
model = 0x5 (5)
stepping id = 0x1 (1)
extended family = 0x0 (0)
extended model = 0x4 (4)
(simple synth) = Intel Mobile Core i3-4000Y / Mobile Core i5-4000Y / Mobile Core i7-4000Y / Mobile Pentium 3500U/3600U/3500Y / Mobile Celeron 2900U (Mobile U/Y) (Haswell), 22nm
miscellaneous (1/ebx):
process local APIC physical ID = 0x0 (0)
cpu count = 0x10 (16)
CLFLUSH line size = 0x8 (8)
brand index = 0x0 (0)
brand id = 0x00 (0): unknown
feature information (1/edx):
x87 FPU on chip = true
virtual-8086 mode enhancement = true
debugging extensions = true
page size extensions = true
time stamp counter = true
RDMSR and WRMSR support = true
physical address extensions = true

3. Command dmidecode - View hardware information

dmidecode is a tool to get hardware information of any Linux system. dmidecode extracts information from computer's DMI (SMBIOS) to display it in a readable form. Example to get information of CPU:

$ sudo dmidecode --type processor

Getting SMBIOS data from sysfs.
SMBIOS 2.8 present.

Handle 0x0400, DMI type 4, 42 bytes
Processor Information
Socket Designation: CPU 0
Type: Central Processor
Family: Other
Manufacturer: QEMU
ID: 54 06 05 00 FF FB 8B 07
Version: pc-i440fx-3.1
Voltage: Unknown
External Clock: Unknown
Max Speed: 2000 MHz
Current Speed: 2000 MHz
Status: Populated, Enabled
Upgrade: Other
L1 Cache Handle: Not Provided
L2 Cache Handle: Not Provided
L3 Cache Handle: Not Provided
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
Core Count: 1
Core Enabled: 1
Thread Count: 1
Characteristics: None


4. Inxi Tool - View Linux system information


$ sudo apt install inxi 	#Debian/Ubuntu systems
$ sudo yum install inxi #RHEL/CentOS systems
$ sudo dnf install inxi #Fedora 22+

To display all CPU information, including each CPU clock and max speed, do the following:

$ inxi -C

CPU:       Dual core Intel Core i5-4210U (-HT-MCP-) cache: 3072 KB 
clock speeds: max: 2700 MHz 1: 1958 MHz 2: 1993 MHz 3: 1775 MHz 4: 1714 MHz

5. lshw Tool - View hardware configuration

lshw can collect detailed hardware information. For example to see CPU:

$ sudo lshw -C CPU

description: CPU
product: Virtual CPU 82d9ed4018dd
vendor: Intel Corp.
vendor_id: GenuineIntel
physical id: 400
bus info: [email protected]
version: pc-i440fx-3.1
slot: CPU 0
size: 2GHz
capacity: 2GHz
width: 64 bits
capabilities: fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx pdpe1gb rdtscp x86-64 constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm avx512f avx512dq clwb avx512cd avx512bw avx512vl xsaveopt arat
configuration: cores=1 enabledcores=1 threads=1


6. hwinfo - Displays current hardware information

  • Installation for SUSE:

yast -i hwinfo

  • for Debian, Ubuntu, Kubuntu, Flubuntu, Xubuntu, GEUbuntu, Edubuntu,…:

apt-get install hwinfo

  • settings for Fedora, Red Hat, Red Flag, Asianux, ...:

yum install hwinfo -y

To view CPU information:

$ hwinfo --cpu

01: None 00.0: 10103 CPU                                        
[Created at cpu.460]
Unique ID: rdCR.j8NaKXDZtZ6
Hardware Class: cpu
Arch: X86-64
Vendor: "GenuineIntel"
Model: 6.69.1 "Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz"
Features: 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,eagerfpu,pni,pclmulqdq,dtes64,monitor,ds_cpl,vmx,est,tm2,ssse3,sdbg,fma,cx16,xtpr,pdcm,pcid,sse4_1,sse4_2,movbe,popcnt,tsc_deadline_timer,aes,xsave,avx,f16c,rdrand,lahf_lm,abm,epb,tpr_shadow,vnmi,flexpriority,ept,vpid,fsgsbase,tsc_adjust,bmi1,avx2,smep,bmi2,erms,invpcid,xsaveopt,dtherm,ida,arat,pln,pts
Clock: 2080 MHz
BogoMips: 4788.92
Cache: 3072 kb
Units/Processor: 16
Config Status: cfg=new, avail=yes, need=no, active=unknown

7. nproc - Print out the number of processors

nproc will show the current number of processors in your computer

$ nproc

To get more information and options, use the following command:

man nproc