How to install htop on FreeBSD

ADVERTISEMENTS



How to install htop on FreeBSD using pkg

I am a new user of FreeBSD operating system. How do I install htop on FreeBSD using the pkg command?htop is nothing but Interactive process viewer for FreeBSD based system. It is just like default top command with an additional set of options and better display on the screen. This page shows

The procedure for installing htop FreeBSD is as follows:

Open the terminal window. For remote FreeBSD server login using ssh command. Execute pkg search htop command to search for htop on FreeBSD Run sudo pkg install htop to install htop in FreeBSD

Let us see all steps and examples in details.

FreeBSD install htop

It is important that you know how to search for any packages. Therefore type the following command to search for htop package using pkg command:

pkg search htop

Sample outputs:

htop-2.2.0_1 Better top(1) - interactive process viewer

Find information about htop package

Run the following command:

pkg search -f htop

Sample outputs:

htop-2.2.0_1 Name : htop Version : 2.2.0_1 Origin : sysutils/htop Architecture : FreeBSD: 12 :amd64 Prefix : /usr/local Repository : FreeBSD [ pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly ] Categories : sysutils Licenses : GPLv2 Maintainer : gaod@hychen.org WWW : https://hisham.hm/htop/ Comment : Better top ( 1 ) - interactive process viewer Options : LSOF : on Annotations : FreeBSD_version: 1200086 Flat size : 160KiB Pkg size : 64.4KiB Description : htop is an enhanced version of top, the interactive process viewer, which can display the list of processes in a tree form. Comparison between 'htop' and 'top' * In 'htop' you can scroll the list vertically and horizontally to see all processes and full command lines. * In 'top' you are subject to a delay for each unassigned key you press ( especially annoying when multi-key escape sequences are triggered by accident ) . * 'htop' starts faster ( 'top' seems to collect data for a while before displaying anything ) . * In 'htop' you don't need to type the process number to kill a process, in 'top' you do. * In 'htop' you don't need to type the process number or the priority value to renice a process, in 'top' you do. * In 'htop' you can kill multiple processes at once. * 'top' is older, hence, more tested. WWW: https://hisham.hm/htop/ htop-2.2.0_1 Name : htop Version : 2.2.0_1 Origin : sysutils/htop Architecture : FreeBSD:12:amd64 Prefix : /usr/local Repository : FreeBSD [pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly] Categories : sysutils Licenses : GPLv2 Maintainer : gaod@hychen.org WWW : https://hisham.hm/htop/ Comment : Better top(1) - interactive process viewer Options : LSOF : on Annotations : FreeBSD_version: 1200086 Flat size : 160KiB Pkg size : 64.4KiB Description : htop is an enhanced version of top, the interactive process viewer, which can display the list of processes in a tree form. Comparison between 'htop' and 'top' * In 'htop' you can scroll the list vertically and horizontally to see all processes and full command lines. * In 'top' you are subject to a delay for each unassigned key you press (especially annoying when multi-key escape sequences are triggered by accident). * 'htop' starts faster ('top' seems to collect data for a while before displaying anything). * In 'htop' you don't need to type the process number to kill a process, in 'top' you do. * In 'htop' you don't need to type the process number or the priority value to renice a process, in 'top' you do. * In 'htop' you can kill multiple processes at once. * 'top' is older, hence, more tested. WWW: https://hisham.hm/htop/

Installing htop on FreeBSD

First, make sure you system is up to date:

sudo pkg update

sudo pkg upgrade

Finally, run the following to install htop on FreeBSD:

sudo pkg install htop



How to use htop command

The syntax is:

htop

htop [options] htop [options] arg



F10

q

One can use a monochrome color scheme, run:

Pressorto quit htop session.

htop -C

htop --no-color

Want to see the tree view by default when running htop? Try:

htop -t

htop --tree

Let us see only processes of a given user named vivek:

htop -u vivek

htop --user=vivek

htop --user=nginx

Limit and show process for only the given PIDs:

htop -p PID

htop -p PID1,PID2

--pid=PID,[,PID,PID...] htop -p 1342

htop -p 7435,1367

FreeBSD htop keyboard shortcut keys

The following commands are supported while in htop:

Command Description Up arrow key Select (highlight) the previous process in the process list. Scroll the list if necessary. Down arrow key Select (highlight) the next process in the process list. Scroll the list if necessary. Left arrow key Scroll the process list left. Right arrow key Scroll the process list right. PgUp, PgDn Scroll the process list up or down one window. Home Scroll to the top of the process list and select the first process. End Scroll to the bottom of the process list and select the last process. s Trace process system calls: if strace(1) is installed, pressing this key will attach it to the currently selected process, presenting a live update of system calls issued by the process. l Display open files for a process: if lsof(1) is installed, pressing this key will display the list of file descriptors opened by the process.

Other keyboard shortcuts

u Show only processes owned by a specified user. M Sort by memory usage (top compatibility key). P Sort by processor usage (top compatibility key). T Sort by time (top compatibility key). F “Follow” process: if the sort order causes the currently selected process to move in the list, make the selection bar follow it. This is useful for monitoring a process: this way, you can keep a process always visible on screen. When a movement key is used, “follow” loses effect. K Hide kernel threads: prevent the threads belonging the kernel to be displayed in the process list. (This is a toggle key.) H Hide user threads: on systems that represent them differently than ordinary processes (such as recent NPTL-based systems), this can hide threads from userspace processes in the process list. (This is a toggle key.) p Show full paths to running programs, where applicable. (This is a toggle key.) Ctrl-L Rfresh the screen. F1 See this help menu.

How to get help about htop

Simply pass the --help option. For example:

htop --help

man htop

Conclusion

This page showed you how to install and use htop on FreeBSD Unix server. It has many more option. Hence, see the htop home page online here or read man page.



0 of 0 in the series. Keep reading the rest of the series: This entry isofin theseries. Keep reading the rest of the series: