PDA

View Full Version : Run program from terminal


petern
04-12-2005, 06:41 AM
How do I start a conventional Mac OS X program from the terminal?

For example Preview. It doesn't work for me to just type Preview in the terminal.

It works really fine starting X11 programs from the X11 terminal window, and I would like to do the same for usual Mac OS X programs from the normal Mac OS X termial window.

acme.mail.order
04-12-2005, 06:47 AM
`open <path>`

e.g.

open /Applications/Preview.app

or

open Desktop/image.jpg

hayne
04-12-2005, 07:41 AM
If you use the "-a" option to the 'open' command, then you don't need to give a path - the system will find the application wherever it is.
E.g.:

open -a Preview
open -a Safari

Twelve Motion
04-12-2005, 09:18 AM
Do you need to type .app?

Raven
04-12-2005, 09:29 AM
With Acme's method, yet, but not with the one proposed by Hayne.