The command line interface is so versatile that you can find considerable information about even the hardware side of your Linux server or desktop.
In this post, we’ll take a look at a bunch of commands that provide details about the CPU inside a Linux computer.
We’ll dig down for information on the CPU vendor, check if it’s 32-bit or 64-bit, look for the number of cores, frequency, cache size and more.
1. Let’s start with lscpu, a favorite of both users and system administrators.
A quick glance at the above output tells us that our Linux box has an Intel, quad-core, 64-bit processor running at 2000MHz.
2. Another favorite of system administrators is /proc/cpuinfo.
Use it with the less prefix since the output is big and quickly vanishes beyond the top of the screen.
As with the previous command, we see that the output of /proc/cpuinfo provides information about the processor, vendor, cores and frequency.
In the following two examples, we’ll tweak /proc/cpuinfo to get only the information we need.
3. If you’re interested in just knowing the CPU vendor, go with cat /proc/cpuinfo along with with the grep command.
$ cat /proc/cpuinfo | grep vendor | uniq
vendor_id : GenuineIntel
The output spits out just the vendor name, nothing more.
4. Now that we have the vendor info (above) let’s dig into details of the Intel processor.
$ cat /proc/cpuinfo | grep 'model name' | uniq
model name : Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz
Voila, your PC runs on a Core 2 Quad core Q9400 processor at 2.66GHz. Not the latest and greatest of processors but adequate for most users.
5. Hardinfo is another handy utility that provides a wealth of information about your Linux system.
Although installed on the command line, hardinfo is actually a GTK based GUI utility.
If hardinfo is not installed on your Linux box, you can do so with the following command on your Ubuntu system.
$ sudo apt-get install hardinfo
If you ask me, hardinfo is an embarras de richesses. Besides the CPU, it provides details on most aspects of the Linux box including memory, storage, PCI devices, storage, USB devices etc plus information on the OS, kernel, and networking.
An extremely handy tool, hardinfo also lets you quickly generate a HTML report that you can save to your machine.
I cannot recommend hardinfo strongly enough. Continue reading »