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

I am looking for an easy way to start different GUI OS X applications from the command line and with different parameters.

If possible I would like to add them to the system PATH in order to call them easier.

Note: I tried open -a "Google Chrome" --args --disable-plugins and it started Chrome but without disabling the plugins.

share|improve this question
possible duplicate of Concisely starting Mac OS apps from the command line – user588 Mar 15 '11 at 15:23
I'd also like to know how to open an application from command line with sudo priviledge – AbiusX Mar 16 '11 at 1:32
I added a bug on Chromium – sorin Mar 16 '11 at 9:32

3 Answers 3

This DOESN'T enable you to send an argument to the application, but I found my way to this thread trying to find a way to open an application from the command line so will at least share how to do that in case anyone else ends up in the same position.

It might work to make an alias in ~/.bash_profile.

For example:

alias affinity="open -a Affinity\"

(No path necessary. Hmm.)

Works for something like:

$ affinity path/to/file.png
share|improve this answer
-1. This will open a file with the given app, but it cannot be used to pass arbitrary arguments. – Blacklight Shining Oct 27 at 7:09
Right. I found my way to it trying to simply find a way to OPEN an app from the command line. I'll edit my reply to at least specify that it doesn't really address the OP's question. – MikeiLL Oct 27 at 19:12
Leaving my downvote because this post still doesn't answer the question. (It would be a better fit for this question, but a similar answer has already been posted there.) – Blacklight Shining Oct 27 at 21:16

Generally, you do something like this:

exec "/Applications/" [arguments]

Running the exec commmand is important, it will end the terminal session and load the command you want. This way you won't kill your program by quitting Terminal or closing the window.

Be sure to also note what the standard flags are set when you double-click the application in the Finder (I've seen about 4 or 5 standard ones) and pass them too for consistent behavior.

As for what you want to do, check the documentation for the application in question.

I don't know if that is the right flag for Chrome, so I can't comment there.

share|improve this answer

Normally you can find the actual executable in the Contents/MacOS folder of the Application bundle. For Chrome try it like so:

/Applications/Google\\ Chrome --disable-plugins
share|improve this answer
Have you tried it? For me it starts Chrome with the plugins enabled. – sorin Mar 15 '11 at 10:37
@sorin-sbarnea Given your problem here and in the question I suspect Chrome has a problem here. I have used Chrome with some arguments in both ways – Mark Mar 15 '11 at 11:09
this does not work in the same manner as openning the application. – AbiusX Mar 16 '11 at 1:31

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.