How to Get CPU Details in Linux Command Line

Learn how you can get various details about your processor in the Linux command line.
Warp Terminal

Being a Linux user, I can relate to your fascination with CPUs.

There are times when you want to know every detail of your computer. How many cores are there? Is it virtual or physical processor? Who is the manufacture? And much more.

So, how do you get CPU details in Linux?

Well, In this tutorial, I will walk you through how you can find three critical aspects of yor CPU:

  1. Getting CPU details
  2. What's the current CPU usage per core
  3. Know the CPU temperature

So let's start with the first one.

Find CPU details in Linux

The easiest way to get the CPU details in Linux is to use the lscpu command. And the best part is it does not require any installation.

To know every detail of your CPU, simply execute the lscpu command as shown here:

lscpu
Get CPU details using the lscpu command

Let's break down the output one by one.

  • Architecture: This indicates the CPU architecture which is x86_64 indicating my CPU is 64-bit.
  • CPU op-mode(s): It shows what kind of processes your computer can handle. As I'm running a 64-bit processor, I can run 32-bit and 64-bit processes.
  • Address sizes: It specifies the memory capabilities of your system.
    • 39 bits physical: CPU can directly address physical RAM up to 512 512 terabytes.
    • 48 bits virtual: CPU can manage virtual memory up to 256 petabytes.
  • Byte Order: Shows the order in which the bytes are arranged. Little Endian means byte with the least significance comes first.
  • CPU(s): Total number of cores including the logical and physical cores.
  • On-line CPU(s) list: It indicates all the cores from 0 to 11 are available and online.
  • Vendor ID: Shows the name of the CPU manufacturer.
  • Model name: As the name suggests, it shows the name of your CPU.
  • CPU family: Indicates the family group of the processor.
  • Model: Shows the internal model number of the processor.
  • Thread(s) per core: A number of threads that each core can handle. In my case, it is 2 so each physical core can utilize 2 threads at once.
  • Core(s) per socket: Shows the number of the physical core on your system.
  • Socket: Number of physical CPU sockets on your system.
  • Stepping: Number of revisions done to your CPU model.
  • CPU max and CPU min: It shows the highest and lowest clock speeds of your CPU.
  • BogoMips: Bogus Millions of Instructions Per Second is a retired and unreliable measurement of CPU speed. It is often seen in the older system.
  • Virtualization: Shows what technology your CPU is using for virtualization. If you're an Intel user, then you'll see VT-x.
  • Caches (sum of all): This section shows the size and level of cache:
    • L1d: Data cache
    • L1i: instruction cache
    • L2: L2 cache
    • L3: L3 cache
  • NUMA node(s): NUMA nodes are a group of CPU cores and memory modules that are physically close together and share a local memory controller.
  • NUMA node0 CPU(s): it indicates that I have a single NUMA node named node0 and all cores reside within the same NUMA code.

Want a GUI tool instead? CPU-X could be what you are looking for.

CPU-X an Alternative to CPU-Z for Linux
Popular Windows tool CPU-Z is not available in Linux. But there is a similar tool called CPU-X. Check it out for getting CPU and other hardware info in Linux.

What else do you need?

Find the current CPU usage per core

You can always use the top command to check the CPU utilization. However the htop command is a little better tool than top. It shows CPU usage for each core and in a better, friendly interface.

But it does not come pre-installed on most Linux distributions.

So here, I will show you how to install and use the htop to monitor the current CPU usage.

For Ubuntu users:

sudo apt install htop

For Fedora users:

sudo dnf install htop

For Arch Linux:

sudo pacman -S htop

Once you are done with the installation, you can start the htop using the following:

htop
use htop to find current CPU utilization

As you can see, it shows how each core is utilized along with the memory consumption and total number of tasks running in your system.

If you want something specifically for CPU utilization, give s-tui a try.

S-TUI: Beautifully Monitor CPU Utilization in Linux Terminal
s-tui is a handy CLI utility that allows you to easily and beautifully monitor CPU utilization with graphs and bars.

Find CPU temperature in Linux

To find the CPU temperature, all you need is a utility called lm-sensors and here's how to install on various Linux distributions:

For Ubuntu/Debian users:

sudo apt install lm-sensors

For Fedora:

sudo dnf install lm_sensors

For Arch:

sudo pacman -S lm_sensors

Once you are done with the installation, execute the following command and it will show the temperature of the CPU:

sensors
Check the CPU temprature using the sensors command in LInux

Wrapping Up

In this tutorial, I went through how you can get CPU details using the lscpu command and have also mentioned how you can check the CPU usage and temperatures.

There are many more tools to get system hardware details in Linux. I used the most common ones here.

Show CPU Details Beautifully in Linux Terminal With CPUFetch
Display CPU details in beautiful ASCII format with this nifty CLI tool.

I hope you will find this quick tip helpful. Let me know if you have any questions.

About the author
Sagar Sharma

Sagar Sharma

A software engineer who loves to write about his experience with Linux. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.