Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Running Programs

To run a program in the shell, you must type the complete pathname of the program’s executable file, followed by any arguments, and then press the Return key. If a program is located in one of the shell’s known directories, you can omit any path information and just type the program name. The list of known directories is stored in the shell’s PATH environment variable and includes the directories containing most of the command-line tools.

For example, to run the ls command in the current user’s home directory, you could simply type it at the command line and press the Return key.

host:~ steve$ ls

If you wanted to run a tool in the current user’s home directory, however, you would need to precede it with the directory specifier. For example, to run the MyCommandLineProgram tool, you would use something like the following:

host:~ steve$ ./MyCommandLineProgram

To launch an application package, you can either use the open command (open MyApp.app) or launch the application by typing the pathname of the executable file inside the package, usually something like ./MyApp.app/Contents/MacOS/MyApp.



< Previous PageNext Page > Hide TOC


Last updated: 2007-10-31




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice