How to get CPU information in Ubuntu?

Two most common terminal commands by which we can get CPU information are:

  1. lscpu
  2. cat /proc/cpuinfo

Here are the example output:

lscpu


hardik@admin-VM:/$ lscpu
Architecture: i686
CPU op-mode(s): 32-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 94
Model name: Intel(R) Core(TM) i7-6820HK CPU @ 2.70GHz
Stepping: 3
CPU MHz: 2712.002
BogoMIPS: 5424.00
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 8192K
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx rdtscp constant_tsc xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch rdseed clflushopt

cat /proc/cpuinfo

hardik@admin-VM:/$ cat /proc/cpuinfo
processor : 0
processor : 0
vendor_id : GenuineIntelcpu
family : 6model : 94
model name : Intel(R) Core(TM) i7-6820HK CPU @ 2.70GHz
stepping : 3
cpu MHz : 2712.002
cache size : 8192 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fdiv_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht nx rdtscp constant_tsc xtopology nonstop_tsc pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch rdseed clflushopt
bugs :
bogomips : 5424.00
clflush size : 64
cache_alignment : 64
address sizes : 39 bits physical, 48 bits virtual
power management:

If you are feeling nerdy, and you want CPU information in much more detail, you can use “cpuid”. “cpuid” does not come by default in Ubuntu so you have to do this:

sudo apt-get install cpuid

Why this post?

I’m trying to learn Assembly. The above mentioned info will be useful in knowing CPU’s capabilities. For example, FPU, MMX etc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s