Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

running applications from the terminal

what is the location of Applications, and is the only thing keeping the terminal from running these applications is the fact that they do not exist within /usr/bin?

1 GHz PPC, Mac OS X (10.3.9)

Posted on Jan 3, 2007 5:10 PM

Reply
3 replies

Jan 3, 2007 7:20 PM in response to starlypt

I can give you some partial answers. If you are running in Terminal, the location of the Applications folder is \Applications. Indeed, this is not in the standard unix path, so you cannot normally run an app in the Applications folder just by typing its name.

However, you can run at least some of the GUI apps from Terminal if you know the proper path. For instance, if you enter the following command into a Terminal window:

/Applications/Preview.app/Contents/MacOS/Preview

the Preview application will start.

If you look at this path name, you can start to see some of the problems with trying to add GUI apps to your unix path. These apps are not directly in the /Applications directory. In general, each GUI app will be in its own directory. So, if you wanted to run lots of GUI apps from Terminal by typoing only the name of the app, you would have to add something to your path for each app. Another issue is that it might not always be clear what is actually the proper file to invoke. For instance, I have tried to start Microsoft Office from Terminal but have failed. It is possible that I did not find the correct file to use. I am also wondering if all GUI applications can be started from the Terminal - I am not convinced that that is the case.

There is one nice feature of the Terminal that is germane to this discussion. If you are in Terminal and your working directory contains some document, you can use the open utility to open that file in the correct GUI application. For instance, if I have a pdf file called test.pdf in my directory, I can issue the Terminal command

open test.pdf

and this will cause Preview (or perhaps Acrobat) to start up and to open the file.

I hope this helps to answer your question. You did not say what it is that you want to do. If you there is a specific task that you would like to accomplish, please let us know and perhaps someone can help. Also, you can get very good help in the unix forum.

Rich

EMAC G4 1.0 GHz Mac OS X (10.4.8)

Jan 4, 2007 2:15 AM in response to starlypt

Hi starlypt,

you can run almost all applications from within Terminal. Just type in the correct path to the UNIX executable. You usually find this in the application package (right click on the application icon and select "show package content") at /Application Name.app/Contents/MacOS/ApplicationName. In the case of e.g. Garageband it is:

/Applications/GarageBand.app/Contents/MacOS/GarageBand

or disk utility:

/Applications/Utilities/Disk Utility.app/Contents/MacOS/Disk Utility

If this answered your question please consider granting some stars: Why reward points?

Jan 4, 2007 10:35 AM in response to Rich JG

You can open an application without any document, or force a document to be opened using a specific application, using open's "-a" argument. For instance,
open -a Preview test.pdf
will cause test.pdf to be opened in Preview, even if you've set all PDF documents to be opened by Adobe PDF Reader.
open -a TextEdit
will open an empty TextEdit window.

Powerbook G4 1GHz Mac OS X (10.3.9)

running applications from the terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.