Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an app name I want to open from command line (using open).

My folder structure is like this:


I want to open the app located in the bar folder, however if I do open -a, the app located in the baz folder will open, even if my current working directory is in the bar folder.

open -a ./ or open -a ~/bar/ doesn't work either.

share|improve this question
up vote 1 down vote accepted

In this case, open -a is NOT what you want; the -a option is for launching known applications (indexed in the Launch Services database that lets you open a document and get the right application) by name, not by pathname, or for opening files with a given application.

What you are looking for is just plain opening, just like you double-clicked it in the Finder. To do that,


This will open exactly that application, without involving the Launch Services database at all.

share|improve this answer

open bar/

If you're using the -a parameter to open, then you need to omit the .app extension.

share|improve this answer
It doesn't matter if I omit the .app extension and what if the executable is not named foo? How would I get the executable name? Example :bar/ – Tyilo Feb 5 '12 at 1:02
Typically the .app bundle and the actual executable file (in the Contents/MacOS/ directory) have the same name. So if the top-level directory is named, I would expect the executable file to be . – bneely Feb 5 '12 at 1:06
But in this case it doesn't... – Tyilo Feb 5 '12 at 1:24
Then you will need to go into the .app directory and determine the name of the executable file in order to type the correct open command. How did you obtain these apps? – bneely Feb 5 '12 at 2:07
It's a jar bundled inside an app so the executable name is actually JavaApplicationStub. I also found out that the executable name is stored in the Info.plist as CFBundleExecutable. – Tyilo Feb 5 '12 at 2:39

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.