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 Comments

Steve  on February 26th, 2008

…or just grep for it in /var/sadm/install/contents

Dmitry Glushenok  on February 27th, 2008

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 Comment