Is there a default location for 'linux too applications'
I recently moved to OS X from Windows 7. In Windows, pretty much everything gets installed to C:\Program Files\[application name]
or C:\[application name]
. In OS X /Applications
seems to be roughly equivalent to C:\Program Files
for all the consumer apps that I use.
But when it comes to a 'linux too' application (e.g. Python, Postgres, Node JS to name just a few) they seem to get installed all over the place. Only after spending a few minutes guessing and using find
did I discover that Postgres executables were installed to /Library/PostgreSQL/9.1/bin/
, v8 and Node were in /usr/local/bin
. Often times these differ to the equivalent paths that I see Linux users refer to.
Is there a better way to discover where my apps are being installed than by having to use find
each time? Shouldn't I be able to predict it with rules of thumb something like 'all database apps should go in /Library
' so that's where I know to look for postgres, and 'all compilers and languages go in /usr/local/bin
' so that's where I know to look for v8 after it's installed?
Solution 1:
The short answer is, unfortunately, no there isn't a default location.
But it's not complete chaos.
For command line tools that ship with the OS or get brought in by Apple-supplied applications like Xcode, you'll find it all in /usr/bin
. That includes things like the OS X default Python and Perl as well as the Xcode-supplied gcc
, clang
, make
and the other command line developer tools Xcode installs.
For non-Apple command line tools, if the application is well-behaved, it should put them in /usr/local/bin
.
Some .app
packaged applications that install under /Applications
offer command line tools (for example subl
offered by Sublime Text 2). If I want to use these from the command line I'll generally make a symlink from /usr/local/bin
to the tool under the .app
file for the application rather than put the application-specific path on my PATH
environment variable.
If you use a package manager like Homebrew to install and manage your command line tools then it's not too much of a hardship to make /usr/local/bin
the place for everything you use. Homebrew does a very nice job of keeping it neat and clean and all in one place for you. I can't speak to how well MacPorts or Fink keep things contained under one sub-tree like this.
The exception to the rules are OS X-default daemons like Postgres and such. Those can get scattered and there really isn't a very good way to track them down aside from find
and maybe mdfind
from the command line.