If I want to find out which directory under /usr/ports contains a port like "gnome-terminal", how can I do that? Is there an easy command? At the moment I use things like

echo */gnome-terminal

but is there a website or guide which tells you this without having to use a trick?

1 Answer 1


There are several ways that you can find a port, including your echo technique. To start, there is the ports site where you can search by name or get a full list of available ports. You can also try:

whereis <program>

but this--like using echo--won't work unless you type the exact name of the port. For example, gnome-terminal works fine but postgres returns nothing. Another way is:

cd /usr/ports
make search name=<program>

but keep in mind that this won't return a nice list; it returns several \n delimited fields, so grep as necessary. I've used both of the above methods in the past but nowadays I just use find:

find /usr/ports -name=<program> -print

Lastly, I will refer you to the Finding Your Application section of the handbook which lists these methods along with sites like Fresh Ports which is handy for tracking updates.


You must log in to answer this question.