Whether you're spinning up a new server, troubleshooting a performance issue, or just curious about the hardware you're working with, knowing your CPU's specifications is fundamental. You might need to confirm if an application is compatible, figure out your capacity for virtualization, or just get a baseline for your system's performance.
Thankfully, Linux doesn't hide this information. It provides a set of straightforward command-line tools that give you a detailed look under the hood. You don't need a fancy graphical interface; just a terminal and a few simple commands will tell you everything you need to know.
Why you might need to check CPU info
There are plenty of practical reasons to check your CPU details. For developers, it might be to ensure that a piece of software will be compatible with the processor's architecture (like x86_64). For system administrators, it could be about optimizing performance or allocating the right number of cores to a virtual machine. Knowing your CPU's capabilities, such as its clock speed, number of cores, and virtualization support, is key to managing any Linux system effectively.
The easiest way: Using the lscpu
command
The most direct way to get a clean, human-readable summary of your CPU's architecture is with the lscpu
command. It’s pre-installed on almost every modern Linux distribution, so you can just open a terminal and run it.
lscpu
The output you get will be a nicely organized list of your CPU's attributes.
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
Vendor ID: GenuineIntel
Model name: Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz
CPU family: 6
Model: 158
Stepping: 9
CPU MHz: 2900.000
BogoMIPS: 5999.85
Virtualization: VT-x
L1d cache: 128 KiB
L1i cache: 128 KiB
L2 cache: 1 MiB
L3 cache: 8 MiB
This output tells you a lot. You can see the architecture, the total number of CPU threads, how many cores and sockets you have, the exact model name, and the clock speed. The "Virtualization" line is also very useful, as it confirms whether your processor supports technologies like Intel's VT-x or AMD's AMD-V, which are necessary for running virtual machines efficiently.
For a deeper dive: /proc/cpuinfo
If you want to see the raw data that tools like lscpu
use, you can look directly at the /proc/cpuinfo
file. The /proc
directory is a special virtual filesystem in Linux that provides a window into the kernel and system hardware.
You can view the contents of this file with a command like cat
or less
.
cat /proc/cpuinfo
The output will be much more verbose than lscpu
because it lists detailed information for every single CPU thread individually. You'll see a separate block of information for "processor 0", "processor 1", and so on.
While it's a lot of information, it can be very useful. For example, if you just want to quickly find the model name, you can filter the output with grep
.
grep "model name" /proc/cpuinfo | uniq
This command searches for the "model name" line in the file and the uniq
command ensures it's only printed once, giving you a clean output.
Other helpful commands for CPU details
While lscpu
and /proc/cpuinfo
are the main tools, a few others are worth knowing.
- nproc: This is a very simple command that does one thing: it tells you the number of processing units (threads) available to the current process.
- htop: For real-time monitoring,
htop
is an excellent interactive tool. It gives you a live, color-coded view of your CPU usage per core, along with memory usage and a list of running processes. It's a great way to see how your CPU is performing at any given moment. You can usually install it with your distribution's package manager, for example:sudo apt install htop
. We have an article that goes in-depth on how to use htop right here.
Conclusion
For Linux users, especially system administrators and developers, these command-line tools make checking CPU information simple and efficient. Commands like lscpu
give you a quick and clear summary, while files like /proc/cpuinfo
offer a deeper level of detail when you need it. The next time you need to peek under the hood of your server, you'll have the right tools for the job.
Thanks for reading! If you're looking for reliable infrastructure, xTom provides enterprise-grade dedicated servers and colocation services, while V.PS offers scalable, production-ready NVMe-powered VPS hosting perfect for any workload. We also offer IP transit, shared hosting, and other general IT services.
Ready to discuss your infrastructure needs? Contact our team to explore the right solution for your projects.
Frequently asked questions about Linux CPU info
What's the difference between a physical CPU, a core, and a thread?
A physical CPU (or socket) is the actual chip installed on the motherboard. That chip contains one or more cores, which are the individual processing units. Many modern cores can handle two tasks at once using a technology called hyper-threading, and each of these tasks is called a thread. So, a single core can appear to the operating system as two logical CPUs or threads.
How can I check if my CPU supports virtualization?
The easiest way is to run lscpu
and look for the "Virtualization" line. If you see VT-x
(for Intel) or svm
(for AMD), then your CPU has the necessary hardware support.
Can I see the current CPU speed, not just the maximum?
The lscpu
command often shows the current speed under "CPU MHz", but this can vary. For a more dynamic view, you can use a command like watch -n 1 "lscpu | grep 'CPU MHz'"
to see it update every second.
Is lscpu
available on all Linux distributions?
Yes, lscpu
is part of the util-linux
package, which is a standard component of virtually all modern Linux distributions, so you can count on it being there.