If you would like to run the app as a different user (e.g., the root account), then you can first switch user accounts in the Terminal with the “su” command, or use “sudo” before specifying the path to the Mac OS application, and this will launch the program as root (note that this might not always work): sudo /Applications/TextEdit.app/Contents/MacOS/textedit This can be useful for troubleshooting problems with the program, since you will see console output (errors, warnings, and sometimes other activity) output directly to the Terminal window hosting the program, as opposed to having to use the Console utility. For instance, opening TextEdit in the Applications folder will require you run the following command: /Applications/TextEdit.app/Contents/MacOS/textedit In most cases, this will be a subdirectory called /Contents/MacOS/ that contains an executable with the same name as the app.
However, to do so for an OS X app with a graphical interface, you will need to specify the app’s executable file within the application package. The classic wayĪs with general Terminal syntax, you can launch an executable script or binary file from the Terminal by simply entering its full path. In addition, you can use this feature to launch multiple instances of a standard OS X program, or run it as a different user, such as root, which can give you access to the system in ways you might otherwise not have. If you do so, then you might find yourself periodically wanting to launch an application, either directly from the command line, or from an automated action like a script. The Terminal is generally reserved as an environment for advanced configuration of your Mac, but there are those who resort to it on a regular basis and use it in conjunction with OS X’s graphical interface to make optimal use of the system.