Os x launch program from terminal




















Open an application from anywhere. The open command normally requires you to input the full file path from your current directory. However, adding -a followed by the name of an application instructs Terminal to open that Application, no matter where it is located.

For example: To open iTunes: open -a iTunes Use quotation marks if the application has a space in its name: open -a "App Store". Open a file with a specific application. You can also use this command to override the default application for a file type. Just type in the file path followed by -a and the application name.

If you're not sure how to enter file paths, see the Troubleshooting section below. For example, you can open a. Include additional options. Enter info open to see a full list of options for modifying the open command. Add -F to open a "fresh" copy of the application.

This will destroy your unsaved changes, but may help if a document is causing the application to crash when opened: open -F -a TextEdit. Open multiple instances of the same application with -n. This may be useful if you are comparing different access levels, or if the application only allows one window.

For example, enter this command repeatedly to open multiple instances of an alarm clock program: open -n -a "Wake Up Time" Note: this is not a default OS X program. This may cause unexpected behavior in other applications that interact with the duplicate application.

Run an application inside Terminal. Instead of just opening an application normally, Terminal can host it. This is useful for debugging, as error messages and other console outputs will appear in that Terminal window. Here's how to do this: [1] X Research source Locate the application in Finder. Right-click the application and select "Show Package Contents. Drag that file onto your blank Terminal command line.

Hit Enter to launch that program. Leave your Terminal window open while you use the application. Quit the application to return to regular Terminal operations.

Part 2. Find the application name. If Terminal displays the error message "Unable to find application named It may take a couple minutes to load the list. Understand absolute file paths. If Terminal displays "the file An easy way to avoid mistakes is to drag and drop the file from Finder directly into your Terminal command line after typing "open," but before hitting Enter. This will enter the absolute file path, which will always point to that file.

It describes the file path in relation to the root directory usually "Macintosh HD". Understands relative file paths. This sends a signal that causes most commands to terminate. Repeat previously entered commands The commands you enter during a session are saved so you can repeat a previously used command without retyping it.

The last command you entered appears on the command line. Continue pressing the Up Arrow key until you see the command you want, then press Return. I am a huge fan from my very start in OS X. And It makes my day. But it is also very handy to just simply open whatever document with the asociated application:. Name required. Mail will not be published required. All Rights Reserved. Reproduction without explicit permission is prohibited. Enjoy this tip?

Subscribe to our newsletter! Thank you! You have successfully joined our subscriber list. Alan says:. October 22, at pm. Gab says:. October 30, at pm. Christopher Anderton says:. July 1, at am. February 6, at am. Lance says:. December 15, at am. June 15, at pm. Matt says:. May 6, at pm. August 22, at am. July 18, at am. July 7, at pm. May 11, at am. November 2, at pm. Manish says:. August 4, at pm. April 19, at pm.



0コメント

  • 1000 / 1000