Common Command-Line Tools for Monitoring Swap in Debian
free -h to display totals, used/available space in a human-readable format (e.g., GB/MB). The output includes a dedicated “Swap” line showing key metrics.Shift + M).top with a more intuitive interface (color-coded, scrollable). Install via sudo apt install htop, then run htop to view swap stats and process-level details.vmstat -s | grep swap to get total/used/free swap values, or vmstat 1 5 to refresh stats every second for 5 iterations.sudo swapon --show to list active swap entries (name, type, size, used space, priority). Combine with -s (swapon -s) for a detailed table.sysstat package (install via sudo apt install sysstat). Collects historical/system activity data; use sudo sar -r 1 10 to report swap usage every second for 10 iterations (shows “kbmemfree”, “kbbuffers”, “kbcached”, etc.).cat /proc/swaps to see active swap devices/files, their sizes, used space, and priority.Graphical Tools for Swap Monitoring
sudo apt install gnome-system-monitor (Debian default) or sudo apt install kde-system-monitor (KDE users). They provide visual graphs for memory/swap usage and process lists.sudo apt install conky, then configure .conkyrc to display swap stats (e.g., Swap: ${swap}M / ${swap_total}M). It runs on the desktop and updates in real time.sudo apt install netdata, then access http://localhost:19999 in a browser. It provides interactive dashboards for swap usage, memory trends, and process-level metrics.