Bashtop is a TUI Linux resource monitor written in Bash. It shows usage / statistics for CPU (including temperature), memory, disks, network and processes.
This tool is fairly new, but it has already gained a lot of popularity. Due to requests to make it cross-platform, its developer is currently rewriting it to use the Python3 psutil library for data collection instead of Linux-specific tools. Bashtop now also works on macOS.
Bashtop lets you filter processes (press f) and it has several sorting options: sort by lazy cpu, adaptive cpu, memory, pid, etc. by pressing the ← or → keys on your keyboard. You can also show detailed information about the process, as well as end, kill or abort the selected process.
While many TUIs (text / terminal user interface) have the ability to use the mouse to perform various operations, do not try to use this with Bashtop as it does not support mouse. That doesn’t make it any less cool, especially when looking at the game-inspired menu (which can be opened by pressing m):
Its menu is not just cool, it also shows the available keyboard shortcuts (at the bottom of Help) and allows you to change various Bashtop configuration options that are otherwise available in the config file ($ HOME / .config / bashtop). From there, you can change the theme (it can automatically download themes from its GitHub repository), update interval, default process sort if it should show cpu temperature, draw clock, and more:
The user interface is responsive but does not display the same amount of information at all sizes. Depending on the size of the terminal, you will see more / fewer processes in the process list and more / less information about cpu, memory and disks.
It is worth noting that the tool has a minimum screen size requirement of 80×25. Most common terminal emulators have a default window size of 80×24, so you need to increase the window height slightly for Bashtop to work.
Bashtop should work with most modern Linux distributions with a terminal that supports truecolor.
Because it’s written in Bash, installing Bashtop is as easy as downloading the bashtop script from its project page (or from the release archive) and installing it somewhere in your PATH. However, it has several dependencies that you need to make sure they are installed on your system (besides additional dependencies, in most cases others should already be installed):
- Bash (it needs version 4.4 or newer, so it won’t work, for example, on Ubuntu 16.04 or CentOS 7)
- Basic GNU utilities
- GNU Grep
- ps from procps-ng (version 3.1.15 or newer, usually a package named procps that you have already installed)
- lm-sensors to display the CPU temperature (the package is usually named lm-sensors or lm_sensors; you need to run sensors-detect as root after installation to detect your computer’s sensors)
- curl to display messages about Bashtop updates and the ability to download additional themes (the curl package is available on most, if not all Linux distributions)