Commands.page Logo

How to Change htop Update Interval on Ubuntu

This article provides a quick guide on modifying the refresh rate of the htop process viewer in Ubuntu. You will learn how to temporarily adjust the update speed during a session and how to make the change permanent by editing the configuration file. These steps ensure you can monitor system resources at a pace that matches your specific debugging or observation requirements.

Adjusting the Interval Temporarily

The fastest way to change the update interval is directly within the htop interface. This method applies only to the current session and resets when you close the application.

  1. Launch htop by typing htop in your terminal.
  2. Press the s key on your keyboard.
  3. Enter the desired delay in seconds (e.g., 0.5 for half a second or 5 for five seconds).
  4. Press Enter to confirm.

Alternatively, you can press F2 to open the Setup menu, navigate to the Delay field, and modify the value there.

Setting a Permanent Update Interval

To save your preferred update interval across all future sessions, you must edit the htop configuration file.

  1. Close htop if it is currently running.
  2. Open the configuration file in a text editor using the following command: bash nano ~/.config/htop/htoprc
  3. Locate the line starting with delay=.
  4. Change the value to your desired interval in tenths of a second. For example, set delay=10 for a 1-second update or delay=5 for half a second.
  5. Save the file by pressing Ctrl+O, then Enter, and exit with Ctrl+X.

The next time you launch htop, it will use the new default update interval.