Browsing the ports collection is really simple and straightforward – cd directory of course changes your current directory and ls displays a list of a directory’s contents. The ports collection is based in /usr/ports – the example below is for navigating to KDevelop (giving full directory listings in the process as you would typically do while browsing for a port to install. | less and q (used to escape less) can be omitted if you have enough screen realestate):

cd /usr/ports
ls | less
q
cd devel
ls | less
q
cd kdevelop

Building/Installing/Uninstalling/Reinstalling/Cleaning a port:

Assuming you have already navigated to the directory of the desired port in /usr/ports

To build a port (sometimes preferred if there is a risk of a failure or if you aren’t too lazy to add the extra word after it in a separate command):

make

To install a port:

make install

To remove a port:

make deinstall

To reinstall a port:

make reinstall

To clean a distfile directory (good to do if you care about disk space and almost always required before doing a reinstall):

One thing worth noting is that there are more advanced features with ports, which are better documented in reference 1 above (this page is meant to be a quick reference only) – however this should work if your just installing to default directories from a host machine or within a jail via ssh.