How to find out where the firefox bin is

filesystemsfirefoxosxpath

I am trying to add Firefox to my PATH like in this tutorial. I have Firefox in the Applications folder of my GUI on my mac book air. I am familiar with adding locations to my path. But I don't know how to find the firefox executable on my machine. Where does the applications folder go to look for the Firefox executable?

Best Answer

The binary would be inside the application bundle. For example,

$ file /Applications/Firefox.app/Contents/MacOS/firefox-bin 
/Applications/Firefox.app/Contents/MacOS/firefox-bin: Mach-O universal binary with 2 architectures
/Applications/Firefox.app/Contents/MacOS/firefox-bin (for architecture x86_64):Mach-O 64-bit executable x86_64
/Applications/Firefox.app/Contents/MacOS/firefox-bin (for architecture i386): Mach-O executable i386

You could launch Firefox by running /Applications/Firefox.app/Contents/MacOS/firefox, and you could put /Applications/Firefox.app/Contents/MacOS in your $PATH to help you save some typing. However, the Mac OS X way to launch an application from the command line would be

open -a Firefox

open(1) is a command-line tool to interact with Launch Services.

Related Question