Helpful HomeBrew and Terminal Commands for Mac OSX

Since i just learn to work with brew and debug some build problems this is a little resoruce to help beginner who like compile there builds. This resource was created by experimenting with a custom MLT build. Read also the Formula Cookbook to learn more . Some note

Xcode is required for adding PHP modules

Brew install all kegs in a Cellar   /usr/local/Cellar//   and simlink them

How to modify brew scripts ? 

Once downloaded all brew scripts can be found following dir . The ruby Install scripts can be edited or extended as you like

/usr/local/Library/Formula

Where is your recent install of Fromula ?

brew --prefix 

All installed Packages via brew

brew list

All Homebrew Logs

/Library/Logs/Homebrew

How to turn on Debug mode for Brew ?

brew install --verbose --debug 

More Brew install with flags

brew install --universal
brew install --build-from-source

Unistall Brew Package

brew uninstall 

How to create a Folder SimLink

ln -s ~/"Foo Bar/" Foo

How to reload .bash_profile from the Terminal 

source ~/.bash_profile

How to identify 32-bit and 64-bit file types on MacOS X ? With  

 file /usr/lib/fooooooo.dylib

Mac Terminal Permission

List all USER  in Terminal

dscl . -list /Users UniqueID

Repair Home User Permission : Replace username with your username all lower case no space
 sudo chown -R username:admin /Users/username

Show Logged in User Name

id -un

List all Groups

dscacheutil -q group

Edit PATH environment vars

Will open the bash_profile with your default editor , in our case with sublime text 2

touch ~/.bash_profile; open ~/.bash_profile

Apache Mac Terminal Commands

start apache Server

sudo apachectl start

Stop Terminate apache

sudo apachectl stop

Restart Apache from Terminal

sudo apachectl restart

Show Apache Version

httpd -v

apache start with terminal output for Error and debugging

apachectl -t

Common Brew install messages

Even after insalling a package dont mean its available for the system if its keg-only its not linked as the system have already a version. If you whant to build with that lib or package you must include the LDFLAGS  and CPFLAGS in your make file or you can try to –force linking for your compile .

keg-Only 

This formula is keg-only, which means it was not symlinked into /usr/local.

OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/curl/lib
    CPPFLAGS: -I/usr/local/opt/curl/include

Apache versions for differnt OSX

OSX Lion

OSX Yosemite is Apache/2.4.10

OSX Snow Leopard Apache/2.2.24

Interesting Follow ups

How to Homebrew install specific version of formula?

Setting up a local web server on OS X