Locating files on Solaris servers with pkgchk

Most Linux and BSD distributions ship with the locate utility, which allows you to quickly find files on a system:

$ locate pvcreate
/usr/sbin/pvcreate
/usr/share/man/man8/pvcreate.8.gz

While not quite as thorough as locate, the Solaris pkgchk utility has a “-P” option that provides similar capabilities:

$ pkgchk -l -P metastat | grep Pathname
Pathname: /sbin/metastat
Pathname: /usr/sbin/metastat
Pathname: /usr/share/man/man1m/metastat.1m

Nice!

2 thoughts on “Locating files on Solaris servers with pkgchk”

  1. IMHO easiest way is:

    # grep metastat /var/sadm/install/contents
    /sbin/metastat f none 0555 root bin 27516 28273 1106445255 SUNWmdr
    /usr/sbin/metastat=../../sbin/metastat s none SUNWmdu
    /usr/share/man/man1m/metastat.1m f none 0644 root root 10861 40881 1158367330 SUNWman
    #

Leave a Reply

Your email address will not be published. Required fields are marked *