Master Real‑Time System Monitoring with btop: Installation, Usage, and Tips
btop is a modern, graphical replacement for the classic top command that runs on Linux, FreeBSD, and macOS; this guide explains how to install it via Snap, APT, source compilation or Docker, shows how to verify the installation, and details its interface, shortcuts, configuration, and additional features.
Introduction
btop is an advanced real‑time system monitoring tool that serves as a modern, graphical alternative to the traditional top command. It works on Linux, FreeBSD, and macOS and displays CPU, memory, disk, network, and process information with interactive controls.
Installation
Method 1 – Snap (recommended)
Snap is supported on Ubuntu 16.04 and newer. Install btop with a single command:
sudo snap install btopMethod 2 – APT (third‑party repository)
btop is not in the official Ubuntu repositories, but you can add a third‑party repo (e.g., the linuxserver/btop repository) and install it:
curl -s https://packagecloud.io/install/repositories/linuxserver/btop/script.deb.sh | sudo bash
sudo apt update
sudo apt install btopIf your Ubuntu version does not support this method, use the Snap approach above.
Method 3 – Build from source
For full control, compile btop from its source code:
sudo apt update
sudo apt install build-essential cmake pkg-config libncursesw5-dev libncurses-dev gettext liblocale-gettext-perl gettext
git clone https://github.com/aristocratis/btop.git
cd btop
mkdir build && cd build
cmake ..
make
sudo make installMethod 4 – Docker
Run btop inside a container without installing it on the host:
docker run -it --rm arslan/btop:latestMethod 5 – Direct git clone (alternative build)
git clone https://github.com/aristocratis/btop.git
cd btop
cmake .
make
sudo make installUninstall (optional)
sudo apt remove btopVerification
After installation, confirm the version: btop --version If successful, the command prints the installed version number.
Run the tool interactively: btop The UI displays several sections:
CPU – per‑core usage, frequency, temperature.
Memory – total, cached, swap, and usage.
Disk – read/write speed and utilization per device or mount point.
Network – per‑interface traffic, IP, and data volume.
Processes – active processes with sorting, searching, and kill capabilities.
Keyboard Shortcuts
btop uses Vim‑like key bindings. Common shortcuts include:
ESC – open/close the settings menu.
m – toggle memory unit (KB/MB/GB).
e – expand/collapse the process tree.
f – search processes in real time.
↑ / ↓ – move the process cursor.
← / → – switch between modules (CPU, memory, disk, etc.).
Enter – confirm or enter a submenu.
k – kill the selected process (SIGTERM).
z – show detailed process information.
q – quit btop.
s – change the process sorting order.
Additional Features
Settings Menu (ESC)
Theme selection.
Enable/disable graphical animations.
Update interval configuration.
Default process sorting method.
Option to expand the process tree on startup.
Toggle swap display and other visual options.
Process Management
Navigate processes with ↑/↓.
Terminate a process using k .
View detailed stats with z .
Search processes with f .
Configuration File
The main configuration file resides at:
~/.config/btop/btop.confTheme Switching
List available themes: ls /usr/share/btop/themes/ Apply a theme, for example:
btop --theme monokaiLiangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
