You are viewing the article How to Open Apps with Terminal on Mac at Tnhelearning.edu.vn you can quickly access the necessary information in the table of contents of the article below.
This article is co-authored by the wikiHow writer, Hunter Rising. Hunter Rising is a wikiHow writer based in Los Angeles. He has over three years of experience writing and working at wikiHow. Hunter holds a BA in Recreational Design from the University of Wisconsin – Stout and a minor in English Writing.
This article has been viewed 10,267 times.
Apple’s Terminal application brings a UNIX command-line environment right on top of OS X. Here you can enter commands to open an application, or open a file with an application. There are many ways to adjust this command to suit user needs, including the ability to control the application right in the Terminal window.
Steps
Open an app
- To open iTunes, type:
open -a iTunes - Use double quotes if the application name contains spaces:
open -a “App Store”
- For example, you can open a .doc file with TextEdit:
open Downloads/Instructions.doc -a TextEdit
- Use -e to specify the TextEdit program, or -t to specify the default text editor:
open Downloads/Instructions.doc -e - Add -g to keep the application running in the background so you can continue working in Terminal:
open -g -a iTunes
- open -F -a TextEdit
- open -n -a “Wake Up Time” (Note: this is not a default OS X program.)
- For applications that have a correlation with their own copy, it can cause unexpected problems.
- Locate the application in Finder.
- Right click on the application and select “Show Package Contents”.
- Locate the executable file. Typically, the file will be located in Contents → MacOS and have the same content as the application.
- Drag the file to the empty Terminal command line. Press Enter to run the program.
- While using the program, you need to leave the Terminal window open. When exiting the application, Terminal will return to normal mode.
Resovle problem
- Click the apple icon in the upper left corner of the screen.
- Hold down the ⌥ Option key and click System Information in the drop-down menu.
- In the left sidebar of the System Information window, click Software → Applications . It will take a few minutes for this list to appear.
- An absolute path always begins with the / character. This character shows the file path relative to the root directory (usually “Macintosh HD” – the default drive partition).
- Type pwd to check the current directory. The file you want to open must be within this directory, not in a higher branch.
- Locate your current directory in Finder. Open a bunch of folders until you find the file you want to open.
- Enter the name of the folder you want to open, separated by a / and then ending with the file name. For example, open Documents/Writing/Novel/ch3.pdf . (If you put ./ before Documents, the same result will be obtained.)
- Select the file in the Finder. Press ⌘ Command + I . On the Info window, look for “file name & extension” to see the full name.
- Or , go to the directory where the file is located. Type ls into the Terminal command line to list the files in the directory.
- Alternatively , you can drag and drop files into the Terminal window.
Advice
- You can use * to represent a sequence of characters, or ? to represent an independent character. [4] X Research Source This works for filenames, but not for application names. For example, the open budget* command will open the first file in a directory whose name starts with “budget.” And the command open budget?.pdf will proceed to open the file “budget1.pdf” but not the file “budget2015.pdf,” because the ? represents only a single character.
Warning
- Some commands do not work on older versions of OS X.
This article is co-authored by the wikiHow writer, Hunter Rising. Hunter Rising is a wikiHow writer based in Los Angeles. He has over three years of experience writing and working at wikiHow. Hunter holds a BA in Recreational Design from the University of Wisconsin – Stout and a minor in English Writing.
This article has been viewed 10,267 times.
Apple’s Terminal application brings a UNIX command-line environment right on top of OS X. Here you can enter commands to open an application, or open a file with an application. There are many ways to adjust this command to suit user needs, including the ability to control the application right in the Terminal window.
Thank you for reading this post How to Open Apps with Terminal on Mac at Tnhelearning.edu.vn You can comment, see more related articles below and hope to help you with interesting information.
Related Search: