How to find your CPU details via the Command Line in Windows, macOS and Linux

I work across so many systems that I frequently forget what types of CPUs I’m dealing with. I keep forgetting the commands necessary to retrieve this information, so here’s a quick cheat sheet with commands.

Windows

We can use the wmic command in a regular Windows Terminal (cmd). It’s slated to be retired in the near future, but works great on Windows 10 and 11 at the time of writing. wmic can take several parameters, the simplest of which looks like this:

wmic cpu get name

Name
Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz
Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz

The output will show all available CPUs if available. To gather more information, you can use these additional parameters too (output looks best with an expanded Terminal window).

wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status

Caption                               DeviceID  MaxClockSpeed  Name                                       NumberOfCores  Status
Intel64 Family 6 Model 63 Stepping 2  CPU0      2301           Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz  12             OK
Intel64 Family 6 Model 63 Stepping 2  CPU1      2301           Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz  12             OK

Another way to retrieve this info is via Windows Powershell using the Get-WmiObject command. We can shorten it like this:

gwmi win32_Processor

Caption           : Intel64 Family 6 Model 63 Stepping 2
DeviceID          : CPU0
Manufacturer      : GenuineIntel
MaxClockSpeed     : 2301
Name              : Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz
SocketDesignation : CPU0

This can be shortened to a more conscience output like so:

gwmi win32_Processor | select name

name
----
Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz

If you’re after more comprehensive system information, try the systeminfo command (although it doesn’t show the CPU name as gwmi does).

macOS

On the Mac we can use sysctl to retrieve the BSD Kernel State. This gives a long list of key/value pairs, so to filter the relevant CPU info out, we can use grep with a pipe.

sysctl -a | grep brand

machdep.cpu.brand_string: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz

Linux

There are various ways to get our CPU info on Linux, many of which retrieve data from /proc/cpuinfo. We can access it manually with cat and take a look at all the glorious entries, or filter it with grep (name is what we’re after).

cat /proc/cpuinfo | grep name

model name      : Intel(R) Core(TM) i3 CPU       M 350  @ 2.27GHz

A convenience command is lscpu, which brings in information from /proc/cpuinfo as well as sysfs and any applicable architecture specific libraries. It works by itself, or can be filtered by name like this:

lscpu | grep name

Model name:                      Intel(R) Core(TM) i3 CPU       M 350  @ 2.27GHz

Enjoy!

You can leave a comment on my original post.