6

Is there a way to list the installed files with pkg for a certain package?

8

pkg info -l PACKAGENAME or pkg info --list-files PACKAGENAME. You can find the -l option in man pkg-info. (And you can in turn find the pkg info subcommand and a pointer to its aformentioned manual page in man pkg.)

0

Although it's not documented in the man page for pkg, pkg list PACKAGENAME is the most concise way, and easiest to remember, at least for me.

One difference between this method and that proposed by @uzsolt is that pkg info -l produces output that is perhaps more suited for "human consumption," with minor touches of formatting:

$ pkg info -l mod_php73
mod_php73-7.3.7:
        /usr/local/libexec/apache24/libphp7.so
        /usr/local/share/licenses/mod_php73-7.3.7/LICENSE
        /usr/local/share/licenses/mod_php73-7.3.7/PHP301
        /usr/local/share/licenses/mod_php73-7.3.7/catalog.mk

pkg list OTOH produces more austere output, strictly a raw list of filenames, suitable for counting, iteration or other forms of "machine consumption":

$ pkg list mod_php73
/usr/local/libexec/apache24/libphp7.so
/usr/local/share/licenses/mod_php73-7.3.7/LICENSE
/usr/local/share/licenses/mod_php73-7.3.7/PHP301
/usr/local/share/licenses/mod_php73-7.3.7/catalog.mk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.