Is there a way in Linux terminal to directly find the processor microarchitecture? For instance if it's Nehalem, Westmere or Sandy Bridge, even if it is with and installable application.
Thanks in advance.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
In theory, the command you're looking for is
lscpu, though it doesn't actually tell you the name of the CPU generation as a text string.
$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 78 Stepping: 3 CPU MHz: 2808.000 BogoMIPS: 5616.00 Hypervisor vendor: Microsoft Virtualization type: full
The relevant values are CPU family and Model. You can compare them (after converting decimal values to hex values, or vice-versa) against this chart from Intel if you have an older CPU, but that chart hasn't been updated since 2012. There's a comment below it giving newer info (May 2015).
For example, in the data above, my CPU has family 6 and model 78 (0x4E). This is unfortunately not listed in the table.
An alternate command is
cat /proc/cpuinfo. This produces largely the same info, but also the model name line, which will contain the processor model number. For example, I get the following:
$cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 78 model name : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz stepping : 3 microcode : 0xffffffff cpu MHz : 2808.000 cache size : 256 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 6 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm pni pclmulqdq est tm2 ssse3 fma cx16 xtpr sse4_1 sse4_2 movbe popcnt aes xsave osxsave avx f16c rdrand hypervisor bogomips : 5616.00 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management: ...
From this, you can see that I have a Intel(R) Core(TM) i7-6600U, which is a 6th-generation (first number following the "i7-" part; see Intel's page on processor numbers) Core-family processor. Unfortunately, there's no really easy way to map that information back to a nice string like "Skylake".
The best way that I've found is to go to http://ark.intel.com/ and put your model string ("i7-6600U") into the search box, select the thing that comes up (there should only be one), and then check the "Related Products" box on the right. There will be a line saying "Products formerly <CODENAME>" that you can use to find the codename. I realize that's far from a neat approach suitable for a script, but if all you care about is the generation, you can script that part with what's given above.
Processor code names aren't intrinsically available from built in tools. The closest you'll get is the processor's model number by using:
Showing only the processor model:
lscpu | grep -i "Model name:" | cut -d':' -f2- -
Also, this source suggests downloading hwloc
Hwloc (Portable hardware locality) is a small utility that reports the structure of the processor in a neat visual diagram. The diagram shows the number of cores, hyperthreads and cache size. A single diagram tells it all.
sudo apt-get install hwloc
The micro architecture codename will be listed below the diagram.