Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This is not really possible since there's no standardized package management.

Unless you configured MacPorts or Homebrew differently, you'll always find their executables in a location that nobody else uses. Since MacPorts and Homebrew do not run under a separate user account, the files they create will always be owned by your user or root.

What's left is that you can only try to guess based on the executable location. Here are some rules:

  • MacPorts uses /opt/local/bin and /opt/local/sbin for executables, everything prefixed under /opt/local.

  • Homebrew uses /usr/local/bin for executables, everything else under /usr/local/.

  • Other applications should create their own directories somewhere under /usr, e.g. /usr/local/git/bin for the Git OS X installer or /usr/X11/bin for X11.

  • Some system frameworks symlink to /usr/bin, e.g. rake points to /System/Library/Frameworks/Ruby.framework

  • No application should ever use /bin or /sbin. No third party application (i.e. anything not an OS X framework) should use /usr/bin either.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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