How to Install and Use gtop on Linux

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.

Gtop is a system monitoring dashboard for your terminal, with a rich graphical display. In this guide, you learn more about gtop and how it compares to the Linux utilities, top and htop. This guide also shows you how to install and get started using gtop on your Linux system.

Before You Begin

  1. Familiarize yourself with our Getting Started with Linode guide and complete the steps for setting your Linode’s hostname and timezone.

  2. This guide uses sudo wherever possible. Complete the sections of our How to Secure Your Server guide to create a standard user account, harden SSH access, and remove unnecessary network services.

  3. Update your system.

    • On Debian and Ubuntu, you can do this with the following commands:

        sudo apt update && sudo apt upgrade
      
    • On AlmaLinux, CentOS (8 or later), or Fedora, use the following command:

        sudo dnf upgrade
      
Note
The steps in this guide are written for non-root users. Commands that require elevated privileges are prefixed with sudo. If you’re not familiar with the sudo command, see the Linux Users and Groups guide.

What is gtop?

Gtop is a graphical system monitoring dashboard for your terminal. Gtop displays your system’s memory, CPU, and disk usage at a glance in an easy-to-read visual layout. Alongside that information, you get a list of running processes with statistics about their CPU, and memory consumption.

gtop vs. htop

Gtop is built on the precedent of htop, which aims to be a more interactive and graphical version of top. If you are unfamiliar, top is a command included by default on most Unix systems for viewing running processes and system usage information. Htop adds vertical and horizontal scrolling, mouse input, more information about processes, and additional features.

Gtop takes up the graphical direction of htop. But unlike htop, which still focuses on listing processes, gtop seeks to provide an almost entirely graphical representation of the system’s usage information. With gtop, you get various graphs in widgets that break up your monitoring into visual sections. Gtop employs distinct coloring in its displays, making it all the more readable, too.

Take a look at the screenshots below, which contrast the displays of top, htop, and gtop.

top

System monitoring display in top

htop

System monitoring display in htop

gtop

System monitoring display in gtop

How to Install gtop

In order to install gtop you need to instal the Node Package Manager (npm). This section shows you how to install npm, using the Node Version Manager (nvm), and then, how to install gtop.

  1. You can use the following commands to install nvm and then use it to install the current version of Node (which includes npm). You may want to consult the nvm installation guide and replace v0.38.0 below with the latest version you see in the guide.

     curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
     source ~/.bashrc
     nvm install node
    

    You can then verify your npm installation with using the --version option.

     npm --version
    
    7.21.0
  2. Install gtop using npm. Use the -g option to install gtop as a global system package.

     npm install gtop -g
    

How to Use gtop

One advantage of gtop is that, despite its graphical display, it is a straight-forward system monitoring application. When you run gtop it immediately starts showing your system’s usage and process information.

gtop

What follows is a breakdown of the parts, or widgets, of the gtop display. You can refer to the screenshots in the What is gtop? section above to follow along.

  • CPU History displays a graph of CPU usage over the last minute. Each line on the graph represents one of your system’s CPUs. In addition, the right side of the widget includes the current percentage usage for each CPU.
  • Memory and Swap History provides the same graphical information but for your system’s memory, both physical and swap.
  • The Memory and Swap widgets display the current percentage usage for physical memory and swap memory, respectively.
  • Network History shows information related to network traffic and includes a graph of bytes-per-second being received over the last minute.
  • The Disk Usage widget displays the current percentage of disk usage on the system.
  • Processes gives you a simplified version of the process listing you could expect from the top command.

Gtop is limited in its interactive options. You can navigate the Processes table with the up and down arrow keys. You can also control the table’s sort order. Press p key to sort by PID (process ID), c key to sort by CPU usage, and m key to sort by memory usage.

Conclusion

For all its simplicity, gtop provides an effective at-a-glance summary of your system. Tools like top and htop focus on providing more comprehensive information about running processes — and, in the case of htop, more control of those processes. Gtop excels if you want to be able to quickly gather your system’s current performance.

Do you like the graphical system monitoring of gtop but want more control and customization? You may want to check out bottom in that case, which takes the visual direction of gtop and gives you more control. Take a look at our guide How to Install and Use bottom to learn more.

More Information

You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.

This page was originally published on


Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.