Fetch CPU Information on Linux|macOS using cpufetch

In this guide we show you how to use a free and open source command line tool, cpufetch, to fetch your Laptop, Desktop, Server or Virtual Machine’s CPU architecture. The cpufetch tool works on macOS, Linux, and Windows operating systems. It supports x86, x86_64 (Intel and AMD) and ARM CPUs. In an x86 system, cpufetch works using the CPUID instruction, and using the MIDR register and Linux filesystem in an ARM system.

The cpufetch tool is able to pull low level information such as number of cores/threads/sockets(CPU topology), CPU microarchitecture, maximum frequency, semiconductor technology in nanometers, L1-L3 cache sizes, FMA, AVX, FMA and peak performance details. The Linux filesystem /sys/devices/system/cpu/ is used to fetch the number of cores and other information.

Building cpufetch from source – Linux / macOS

The easiest and quickest way to install cpufetch tool on Linux and macOS is by building from source.

Install git and development tools:

# CentOS / RHEL / Fedora
sudo yum -y install git
sudo yum -y group install "Development Tools"

# Ubuntu / Debian
sudo apt update
sudo apt install git build-essential -y

Confirm gcc and make tools are available

$ make --version
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Clone cpufetch git repository:

git clone https://github.com/Dr-Noob/cpufetch

Switch to cpufetch source folder

cd cpufetch

Compile the application:

make

Run the command below to make the binary available in your PATH:

$ sudo make install
install -Dm755 "cpufetch"   "/usr/bin/cpufetch"
install -Dm644 "LICENSE"    "/usr/share/licenses/cpufetch-git/LICENSE"
install -Dm644 "cpufetch.8" "/usr/share/man/man8/cpufetch.8.gz"

Or move move the binary manually:

sudo mv ./cpufetch /usr/local/bin

Confirm cpufetch command is installed:

$ cpufetch --version
cpufetch v0.97 (x86_64 build)

Viewing usage help page:

cpufetch --help

Pulling your system CPU architecture information:

cpufetch

Sample Outputs are shown in attached screenshots.

macOS Intel CPU:

Digital Ocean Virtual Machine:

AMD CPU:

ARM Architecture:

Uninstalling cpufetch

To uninstall cpufetch, remove binary from the source folder:

rm -rf ~/cpufetch

And remove the executable file via command:

sudo rm /usr/local/bin/cpufetch
sudo rm /usr/bin/cpufetch

Enjoy using cpufetch and check more similar guides:

Recommended Linux Books  to read:

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

AlmaLinux OS is a Linux operating systemd forked from RHEL by the team behind CloudLinux. It is meant to be […]

I recently experienced the error Failed creating Qemu driver: exec: “qemu-system-x86_64”: executable file not found in $PATH while trying to […]

In a Linux file system, files are stored within a single directory structure, called a virtual directory. The virtual directory […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.