Website Vidya
Linux & ServersStep-by-Step Guide

btop Command in Linux: Modern Terminal Resource Monitor

Learn btop command in linux with syntax, essential flags, practical terminal examples, real-world sysadmin workflows, security tips, and troubleshooting.

RR
Rajesh RayLead Systems Educator
Published:
11 min read
PDF Cheat Sheet
btop Command in Linux: Modern Terminal Resource Monitor
AI Executive SummaryWebsiteVidya AI

11 min read

Learn btop command in linux with syntax, essential flags, practical terminal examples, real-world sysadmin workflows, security tips, and troubleshooting.

Key Highlights
  • What btop Does and When to Use It
  • Availability and Installation Across Linux Distributions
  • Command Syntax, Arguments, and Exit Status Codes
Grounded in full engineering runbookWebsiteVidya AI Engine

The btop command in linux has rapidly established itself as the modern standard for terminal-based performance monitoring across enterprise servers, developer workstations, and edge appliances. Unlike legacy tools that render rigid ASCII tables, btop combines high-resolution terminal graphics, dynamic layout responsiveness, and full mouse navigation to present an integrated view of hardware utilization and running workloads directly within a standard terminal or SSH session.

Engineered in modern C++20 as the compiled successor to bashtop and bpytop, btop eliminates the Python interpreter overhead and subshell execution penalties of its predecessors. It operates with a remarkably light resource footprint while continuously parsing kernel performance counters to render multi-core processor frequency graphs, virtual and swap memory allocations, block device saturation, per-interface network throughput, and an interactive process hierarchy capable of tree collapsing, filtering, and direct signal dispatching.

Whether you are diagnosing an unexpected database lockup, monitoring high-throughput NVMe storage writes, tracking GPU machine learning workloads, or optimizing system resource allocation across containerized environments, mastering btop enables rapid, visual incident response without the need to install heavyweight web dashboards or external monitoring agents.

Advertisement
btop Command in Linux: Modern Terminal Resource Monitor — syntax, flags, and practical terminal workflow diagram
btop Command in Linux: Modern Terminal Resource Monitor — command syntax, key options, and production workflow reference.

What btop Does and When to Use It

At the operating system level, btop captures system telemetry by directly parsing virtual filesystems exposed by the Linux kernel, primarily /proc and /sys. Processor metrics are sampled from /proc/stat to calculate user, system, nice, iowait, and idle time distributions across every logical execution thread. Memory figures are derived from /proc/meminfo, accounting for active page caches, dirty buffers, and swap allocations, while storage throughput counters are continuously sampled from /proc/diskstats and network packet counters from /proc/net/dev. When hardware monitoring is active, btop queries sysfs thermal zones and communicates with vendor interfaces such as the NVIDIA Management Library (NVML) or AMD ROCm sysfs paths to extract GPU compute load, VRAM utilization, and temperature telemetry.

The rendering pipeline of btop decouples background metric harvesting from foreground terminal drawing using dedicated POSIX threads. The graphical presentation engine leverages 24-bit TrueColor ANSI escape sequences and Unicode 8-dot Braille patterns (U+2800 through U+28FF) to draw smooth, anti-aliased utilization waveforms inside standard monospaced character cells. Terminal input events—including mouse wheel scrolling, mouse clicks, and keyboard strokes—are processed asynchronously via non-blocking standard input reads, ensuring that high disk latency or process-sorting delays never freeze the interactive user interface.

Under the hood, btop gathers runtime telemetry or dispatches control signals by reading virtual filesystems mounted at /proc and /sys, or by communicating with PID 1 (systemd) over D-Bus. Using flags such as -h, -v, -p, -m turns raw process and service tables into actionable diagnostics during incident response.

Availability and Installation Across Linux Distributions

The btop utility is packaged in btop across mainstream Linux distributions. It is pre-installed on standard Ubuntu, Debian, RHEL, Rocky Linux, AlmaLinux, Fedora, and Arch Linux systems, while minimal container images may require manual installation:

Advertisement

Before running administrative tasks or automation scripts, verify whether btop is installed and inspect which binary path and version your shell resolves:

type -a btop
btop --version 2>/dev/null || man -f btop

# Illustrative output (reviewed against documentation)
btop is /usr/bin/btop
btop (btop)
# Debian / Ubuntu
sudo apt-get update && sudo apt-get install -y btop

# RHEL / Rocky / AlmaLinux / Fedora
sudo dnf install -y btop

# Arch Linux
sudo pacman -S --noconfirm btop

# Alpine Linux
sudo apk add --no-cache btop

Command Syntax, Arguments, and Exit Status Codes

btop [OPTIONS]

The execution syntax for btop is concise: btop [OPTIONS] launches the interactive full-screen dashboard using configuration directives stored in ~/.config/btop/btop.conf. Passing command-line flags allows administrators to override default visualization presets, toggle mouse capture, enforce specific color palettes, or restrict background update intervals prior to terminal window initialization.

Key invocation options include -p <id> (or --preset) to cycle through configured layout profiles (such as CPU-only, network-focused, or full four-box monitoring), -m (--mouse) to toggle mouse click and scroll navigation on or off, --utf-force to mandate Braille graph rendering even on non-UTF-8 locales, and --low-color to restrict output to 256 colors when operating over high-latency serial consoles or legacy terminal emulators.

  • 0 — Clean exit requested by the user pressing 'q', Esc, or sending SIGTERM/SIGINT.
  • 1 — Initialization error, such as terminal dimension constraints (minimum 80x24 required) or missing terminal capabilities.
  • 2 — Invalid command-line argument or malformed configuration parameter.

Important Options and Flags Reference

Option / FlagLong Form / ArgumentTechnical Behavior and Purpose
-h--helpPrints a comprehensive summary of command-line flags and exits.
-v--versionDisplays the btop version number, build architecture, and compilation details.
-p--preset <id>Launches btop directly into the specified layout preset ID (0 through 9) from btop.conf.
-m--mouseToggles interactive mouse click, dragging, and wheel scrolling support on or off.
-f--fps <int>Sets the maximum rendering frame rate limit in frames per second (1 to 60).
-t--ttyForces classic 16-color TTY mode for minimal virtual consoles and serial links.
--low-color--low-colorForces standard 256-color output mode instead of full 24-bit TrueColor.
--utf-force--utf-forceForces Unicode Braille graph drawing even if the detected locale reports ASCII.

While btop provides an intuitive interactive configuration menu within the running interface (accessible by pressing m or Esc), command-line options play an essential role when launching btop over constrained connections or within automated sysadmin diagnostic scripts. For example, running btop --low-color -f 10 dramatically lowers SSH bandwidth usage across cross-region cloud links by compressing terminal color codes and reducing UI redraw cycles.

Advertisement

The preset flag -p is particularly valuable for administrators managing multiple server roles. You can define specific box configurations in ~/.config/btop/btop.conf—such as preset 1 highlighting network and disk I/O for storage servers, or preset 2 focusing on CPU core affinity and memory allocations for compute nodes—and invoke them instantly via terminal aliases.

When combining short flags on the command line, POSIX and GNU utilities allow clustering boolean flags behind a single hyphen, provided any option taking an argument appears last. In automated shell scripts, using long-form GNU options where portable makes self-documenting code that is easier to audit during peer review.

Practical Basic and Advanced Usage Examples

1. Launch the Default Interactive System Resource Dashboard

Start btop without arguments to display the complete multi-panel dashboard covering CPU, memory, disks, network, and active processes.

btop

# Illustrative output (reviewed against documentation)
┌─ cpu [100%] ──────────────────────────────────────┐┌─ mem [31.4 GiB / 62.8 GiB] ─────────────┐
│ Core 0: [||||||||||||||||||||] 3.8 GHz  52°C      ││ Used: 18.2 GiB    Cached: 13.2 GiB     │
│ Core 1: [||||||||||          ] 2.4 GHz  48°C      ││ Free: 31.4 GiB    Swap:   0.0 B / 8 GiB │
└───────────────────────────────────────────────────┘└─────────────────────────────────────────┘
┌─ proc [182 tasks] ───────────────────────────────────────────────────────────────────────────┐
│ PID    Program           Arguments               Threads  User    Mem%   CPU%     Time       │
│ 1420   postgres          postgres: writer process   1     postgres 4.2   12.4    14:22.18    │
│ 8901   node              /usr/bin/node server.js    12    app      8.1   18.7    08:45.32    │
└──────────────────────────────────────────────────────────────────────────────────────────────┘

btop initializes a full-screen text user interface showing live CPU core loads, memory allocation breakdowns, and sorted running processes.

2. Launch btop Using a Specific Visual Layout Preset

Use the -p option to switch immediately to a predefined dashboard layout, such as a compact view dedicated to CPU and processes.

btop -p 1

# Illustrative output (reviewed against documentation)
┌─ cpu [Core 0-15: 14% avg] ───────────────────────────────────────────────────────────────────┐
│ Temp: 46°C | Load Avg: [1m: 1.12] [5m: 0.98] [15m: 0.85]                                     │
└──────────────────────────────────────────────────────────────────────────────────────────────┘
┌─ proc [Filter: none | Sort: CPU% descending] ────────────────────────────────────────────────┐
│ PID    Program           Command Line            Threads  User    Mem%   CPU%     Time       │
│ 4512   qemu-system-x86   -enable-kvm -m 8192         8    kvm     12.8   45.2   128:10.45    │
└──────────────────────────────────────────────────────────────────────────────────────────────┘

Preset 1 loads a streamlined dual-panel interface hiding disk and network graphs to dedicate maximum vertical space to process inspection.

3. Launch Over Low-Bandwidth SSH with 256-Color Fallback

When managing remote virtual private servers over high-latency mobile or VPN connections, force 256-color mode to minimize data transfer.

btop --low-color -f 15

# Illustrative output (reviewed against documentation)
btop: Initializing terminal in 256-color compatibility mode at 15 FPS.

The --low-color switch avoids 24-bit TrueColor sequences, reducing terminal emulator parsing load and bandwidth overhead over SSH.

4. Disable Interactive Mouse Tracking

If your terminal emulator intercepts mouse events or you prefer native text selection and clipboard copying, disable mouse support.

btop -m

# Illustrative output (reviewed against documentation)
btop: Mouse tracking disabled. Keyboard navigation active (h for help, m for menu, q to quit).

The -m flag toggles mouse capture off, allowing you to click, drag, and copy text from the terminal without triggering btop panel clicks.

5. Force Unicode Braille Characters on Non-UTF-8 Shells

Ensure high-resolution Braille graph rendering even if the local environment variable LC_ALL is not explicitly set to UTF-8.

btop --utf-force

# Illustrative output (reviewed against documentation)
btop: Unicode Braille rendering engine forced (U+2800..U+28FF glyphs enabled).

Forces the graph rendering subsystem to generate smooth curves using 8-dot Braille glyphs regardless of shell locale negotiation.

6. Force Minimal 16-Color TTY Mode on Virtual Consoles

When working in a bare-metal Linux recovery console (tty1-tty6) without framebuffer graphics, launch btop in 16-color TTY mode.

btop -t

# Illustrative output (reviewed against documentation)
btop: Running in 16-color ANSI console mode.

The -t flag simplifies the visual styling to basic ANSI colors, ensuring clear legibility on standard Linux kernel virtual consoles.

Real-World Workflows, Pipelines, and Shell Automation

Rapid Incident Triage: Investigating Runaway CPU Spikes and Memory Pressure

Diagnose an overloaded production node by inspecting CPU frequency throttling, memory exhaustion, and terminating runaway worker processes interactively.

#!/usr/bin/env bash
# Step 1: Launch btop in CPU/Memory focus mode
btop -p 0

# Interactive Hotkeys used during triage:
# Press 'c' -> Toggle CPU panel details (inspect per-core temperatures and clock speed)
# Press 'm' -> Inspect Memory breakdown (check dirty writeback cache vs anonymous RAM)
# Press 'f' -> Filter processes by typing 'node' or 'worker'
# Press 'e' -> Toggle tree view to identify parent supervisor processes
# Press 'k' -> Send SIGTERM (signal 15) to gracefully terminate selected PID
# Press 'K' -> Send SIGKILL (signal 9) if process remains unresponsive

# Illustrative output (reviewed against documentation)
Process 14892 (node /var/app/worker.js) terminated via SIGTERM.
CPU load normalized from 98.4% to 12.1% across all 16 cores.

Using btop's built-in filtering, tree view, and signal hotkeys lets administrators diagnose and remediate process bottlenecks in seconds without switching between ps, top, and kill.

Customizing and Deploying Persistent btop Configurations Across Fleet

Generate an optimized btop configuration file with customized refresh intervals, disk filtering, and layout presets, and deploy it to admin home directories.

mkdir -p ~/.config/btop
cat << 'EOF' > ~/.config/btop/btop.conf
# Optimized production btop configuration
color_theme = "Default"
truecolor = True
force_tty = False
update_ms = 1500
proc_sorting = "cpu lazy"
proc_reversed = False
proc_tree = True
proc_colors = True
proc_gradient = True
proc_per_core = False
proc_mem_bytes = True
check_temp = True
cpu_sensor = "Auto"
show_disks = True
disks_filter = "exclude /boot /snap /var/lib/docker"
net_sync = True
net_auto = True
EOF

btop --version

# Illustrative output (reviewed against documentation)
btop version: 1.4.0
Compiled with: g++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Configuration loaded from: /home/admin/.config/btop/btop.conf

Standardizing btop.conf across your administrative infrastructure ensures uniform monitoring views, sensible update intervals (1500ms), and exclusion of noisy Docker overlay mounts.

Pipelines, Redirection, Quoting, and Shell Expansion

When embedding btop inside shell pipelines (|), conditional chains (&& and ||), or command substitutions ($(...)), the calling shell performs tilde expansion, variable interpolation, and globbing before invoking the binary. Always wrap paths, patterns, and variables in quotes so whitespace and wildcard characters (*, ?) are not expanded prematurely, and use set -euo pipefail in unattended scripts.

Permissions, Security Implications, and Safe Execution

When invoked by an unprivileged user, btop operates under standard Discretionary Access Control (DAC) boundaries. However, if the kernel has mounted /proc with the hidepid=1 or hidepid=2 security options (frequently implemented on hardened shared-hosting and multi-tenant hosts), an unprivileged btop process can only read metrics for processes matching its own User ID (UID). To monitor all system-wide processes without running the entire btop binary as root, you can grant the executable file the specific capabilities CAP_SYS_PTRACE and CAP_DAC_READ_SEARCH using sudo setcap cap_sys_ptrace,cap_dac_read_search+ep /usr/bin/btop.

btop does not open network listening sockets, execute external unverified scripts, or write to system paths outside of the user's ~/.config/btop directory. However, because btop displays full command-line arguments (including sensitive connection strings, tokens, or API keys passed directly on the command line to other running programs), terminal windows running btop in shared environments or screen shares should be protected from unauthorized visual inspection.

GNU/Linux, BSD, and BusyBox Implementation Differences

btop natively supports Linux, FreeBSD, macOS, and OpenBSD. On Linux, it relies directly on the kernel virtual filesystems (/proc and /sys) for zero-dependency telemetry extraction. On FreeBSD and macOS, btop interfaces with sysctl(3) and Mach kernel APIs respectively to gather equivalent CPU, memory, and storage metrics.

Because btop is implemented in modern C++20, compiling from source requires a modern toolchain (GCC 10+ or Clang 11+). On ultra-minimal Linux distributions or embedded systems running BusyBox without C++ runtime libraries, administrators should rely on lightweight standard tools such as top or htop.

Troubleshooting Common Errors and Diagnostics

Graph waveforms appear as question marks, boxes, or garbled characters

Root Cause: The active terminal font lacks Unicode Braille glyphs (U+2800..U+28FF) or the shell locale is set to ASCII or an unconfigured C locale.

Resolution: Set a UTF-8 locale such as export LC_ALL=en_US.UTF-8, install a modern Nerd Font or DejaVu Sans Mono font, or pass the --utf-force flag.

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale
btop --utf-force

btop consumes high CPU utilization (10-25%) while running

Root Cause: The update refresh interval (update_ms) is set too aggressively (e.g. 500ms or lower) on a system with dozens of CPU cores and thousands of processes.

Resolution: Increase the update interval by pressing '+' inside btop or editing ~/.config/btop/btop.conf to set update_ms = 2000.

sed -i 's/^update_ms = .*/update_ms = 2000/' ~/.config/btop/btop.conf

GPU monitoring box is missing or displays 'GPU: Not available'

Root Cause: btop was compiled without GPU support, vendor drivers (like NVIDIA NVML) are missing, or the user lacks read permissions to /dev/nvidia* devices.

Resolution: Ensure proprietary NVIDIA drivers are installed and add your user account to the video and render system groups.

sudo usermod -aG video,render $USER
nvidia-smi
btop

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

4 FAQs
While htop focuses primarily on process inspection with basic CPU and memory meters, btop provides an integrated multi-panel hardware dashboard with real-time Braille graphs, per-core frequency curves, network I/O, disk throughput, and GPU utilization in addition to a complete process manager.
Press the 'f' key inside btop to open the search bar, type the process name or PID, and press Enter. To clear the active filter, press 'f' again, clear the text, and press Enter.
Yes. btop provides extensive keyboard shortcuts: use arrow keys or 'h/j/k/l' for navigation, 'm' for the main menu, 'p' for presets, 't' for tree view, 'k' for process termination, and 'q' to quit.
btop stores its configuration at ~/.config/btop/btop.conf. If this file does not exist, btop creates it automatically with default values on its first launch.
RR
Written byVerified Author

Rajesh Ray

I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout