Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to store code and install applications on Mac OS X - switching from Windows

here's a few newbie questions from someone who has spent 15+ year coding in Windows but is starting from scratch on Mac OS X. I have searched the web and this site and not found answers, but I think the answers will be useful to a lot of people.

Very simply....

  1. where should I store private code and projects in the file system? My user directory? In /usr/?

  2. where should I store shared code and projects?

  3. where should I set up a github repository?

  4. once built, where should I install applications? I see lots of possibilities here. /opt/, /var/lib, /usr/local/var etc.

  5. perhaps most interesting of all: how can I get a simple run-down of the location of everything that has been installed on my Mac?

I would imagine that over the 40 years of UNIX history some standards have emerged for these but so far I have been unable to find them. There must be some 'best practice' guidelines that I should follow.

Oh by the way I'm talking about things like PostgreSQL and such like. Not proper Mac applications.

The reason I ask is that I've come across a variety of ways to install things that seem to have their own ideas of where to install the same application. e.g. homebrew, ant, etc. These sometimes result in different installation locations than following an FAQ or documentation for a manual installation of the application.

Appreciate any answers on these.

Many thanks.

like image 250
Bit Rocker Avatar asked Aug 17 '12 16:08

Bit Rocker


1 Answers

Github has a very nice Mac application that can download and sync your Github repositories. By default it places them in subdirectories within ~/Documents (your home folder's documents directory).

My home setup is to create a git directory inside ~ and just use that for private projects. For shared projects, place them in /Users/Shared (there's a common share folder in Mac OS for everyone)

As far as installing command line tools, Macs are like BSD boxes.. install in /usr/local/bin etc. Graphical applications should go in /Applications. Github's mac app installs a command line tool (optionally) in /usr/local/bin.

Some package tools on OS X create their own directory hierarchy (fink, macports), but mirports installs in /usr/local.

like image 90
Lucas Holt Avatar answered Oct 23 '22 09:10

Lucas Holt