The following example shows the path and target of links installed by the specified packages. In addition to the attributes shown in the pkg(5) man page, several pseudo attributes are available to use. See the pkg(1) man page for a list of pseudo attributes.
In the following example, the pkg.name pseudo attribute shows the name of the package that delivers the specified action. In this example, both Python 2.6.8 and Python 2.7.3 are installed, and the command shows the path to use to access the specific version if you do not want to rely on the /usr/bin/python link. See also Specifying a Default Application Implementation for information about mediations of multiple versions.
$ pkg contents -t link -a path=usr/bin/python -o path,target,pkg.name PATH TARGET PKG.NAME usr/bin/python python2.6 runtime/python-26 usr/bin/python python2.7 runtime/python-27