Is there a way to find out which Application / package owns or creates a specific file? For example, in Linux these commands will show the package owner
apt-file /bin/progname
rpm -qf /bin/progname
yum whatprovides /bin/progname
In OS X, a file could be part of a native OS X application, or installed by Macports or Homebrew. These are completely different environments. Are there commands for each environment to check which application / package owns a specific file?
Best Answer
It's a little late, but perhaps it will be of help to others.
You can use the
pkgutil
command.For example, if you want to know what package the "less" command belongs to run:
pkgutil --file-info /usr/bin/less
Which will output something like:
To list all files contained in a package,
com.apple.pkg.BaseSystemBinaries
in our example, run:pkgutil --files com.apple.pkg.BaseSystemBinaries
I know this tool has been present since OS X 10.6.