cross-posted from: https://lemmy.run/post/8710

Beginner’s Guide to htop

Introduction

htop is an interactive process viewer and system monitor for Linux systems. It provides a real-time overview of your system’s processes, resource usage, and other vital system information. This guide will help you get started with htop and understand its various features.

Installation

We are assuming that you are using ubuntu or debain based distros here.

To install htop, follow these steps:

  1. Open the terminal.
  2. Update the package list by running the command: sudo apt update.
  3. Install htop by running the command: sudo apt install htop.
  4. Enter your password when prompted.
  5. Wait for the installation to complete.

Launching htop

Once htop is installed, you can launch it by following these steps:

  1. Open the terminal.
  2. Type htop and press Enter.

Understanding the htop Interface

After launching htop, you’ll see the following information on your screen:

  1. A header displaying the system’s uptime, load average, and total number of tasks.
  2. A list of processes, each represented by a row.
  3. A footer showing various system-related information.

Navigating htop

htop provides several keyboard shortcuts for navigating and interacting with the interface. Here are some common shortcuts:

  • Arrow keys: Move the cursor up and down the process list.
  • Enter: Expand or collapse a process to show or hide its children.
  • Space: Tag or untag a process.
  • F1: Display the help screen with a list of available shortcuts.
  • F2: Change the setup options, such as columns displayed and sorting methods.
  • F3: Search for a specific process by name.
  • F4: Filter the process list by process owner.
  • F5: Tree view - display the process hierarchy as a tree.
  • F6: Sort the process list by different columns, such as CPU usage or memory.
  • F9: Send a signal to a selected process, such as terminating it.
  • F10: Quit htop and exit the program.

Customizing htop

htop allows you to customize its appearance and behavior. You can modify settings such as colors, columns displayed, and more. To access the setup menu, press the F2 key. Here are a few options you can modify:

  • Columns: Select which columns to display in the process list.
  • Colors: Customize the color scheme used by htop.
  • Meters: Choose which system meters to display in the header and footer.
  • Sorting: Set the default sorting method for the process list.

Exiting htop

To exit htop and return to the terminal, press the F10 key or simply close the terminal window.

Conclusion

Congratulations! You now have a basic understanding of how to use htop on the Linux bash terminal. With htop, you can efficiently monitor system processes, resource usage, and gain valuable insights into your Linux system. Explore the various features and options available in htop to get the most out of this powerful tool.

Remember, you can always refer to the built-in help screen (F1) for a complete list of available shortcuts and commands.

Enjoy using htop and happy monitoring!