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.
Last updated: 2007-10-31