# finding a package with xyz executable?



## graemeg (Nov 13, 2018)

Hi there. Normally I use `pkg which <exact_path_to_file>` so the system can tell me which package an executable or library is coming from. I used to use a utility called `rport` to post messages to a NNTP news server using the command line (ie: scripts). I reinstalled my system and now `rpost` doesn't exist. For the life of me I can't figure out which package contains that utility.  I know it existed before on my previous FreeBSD install, and if you do a Google search you can even find the online man page for it. [https://www.gsp.com/cgi-bin/man.cgi?section=1&topic=rpost]

Anybody got any clues how I query the packages or ports? Anybody know which package contains that utility? Any help would be greatly appreciated.


----------



## talsamon (Nov 13, 2018)

1) If you search related files and have a man page, look under section "files" or "see also".
2) Usally, binaries (of ports) are installed in /usr/local/bin or /usr/local/sbin.
3) find /usr/ports/* -name pkg-plist\* -print0|xargs -0 grep -i "what_you_search"

1) and 3)  has the result news/suck


----------



## olli@ (Nov 13, 2018)

There is a search engine for FreeBSD ports called “Porgle”.
It finds the ports *news/suck* and *ports/suck-cnews* that both contain an `rpost` binary:
[URL]http://inof.de/FreeBSD/porgle/porgle.py?plst=1&q=%2F%5Erpost%24%2F[/URL]


----------



## scottro (Nov 13, 2018)

There's a package called pkg-provides that tells you what port supplies what file, similar to RedHat's yum provides or Debian's apt-file-cache search.


----------

