htop command in Linux with examples

htop command in Linux system is a command line utility that allows the user to interactively monitor the system’s vital resources or server’s processes in real time. htop is a newer program compared to top command, and it offers many improvements over top command. htop supports mouse operation, uses color in its output and gives visual indications about processor, memory and swap usage. htop also prints full command lines for processes and allows one to scroll both vertically and horizontally for processes and command lines respectively.

Syntax:

htop [-dChusv]

Example:

Options:

  • -d –delay : Used to show the delay between updates, in tenths of seconds.
  • -C –no-color –no-colour : Start htop in monochrome mode.
  • -h –help : Used to display the help message and exit.
  • -u –user=USERNAME : Used to show only the processes of a given user.
    htop -u kunwarvikas

  • -p –pid=PID, PID… : Used to show only the given PIDs.
  • -s –sort-key COLUMN : Sort by this column (use –sort-key help for a column list).
  • -v –version : Output version information and exit.

Interactive Commands:

  • Arrows, Page Up, Page Down, Home, End: Scroll the process list.
  • Space: Tag or untag a process.
  • U – Untag all processes (remove all tags added with the Space key).
  • s – Trace process system calls.
  • F1 – Help
  • F2 – setup
  • F3 – search
  • F4 – filtering: type in part of a process command line and only processes whose names match will be shown.
  • F5 – Tree view.

  • F6 – Sorting.
  • F7 – Increase the selected process’s priority. This can only be done by the superuser.
  • F8 – Decrease the selected process’s priority.
  • F9 – Kill process.
  • F10 – Quit.


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.