• About
  • Contact
  • Cookie
  • Disclaimer
  • Privacy Policy
  • Change the purpose of use

Tnhelearning.edu.vn - Various useful general information portal

  • Photo
  • Bio
  • How To
  • Tech

How to Open Apps with Terminal on Mac

February 14, 2024 by admin Category: How To

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.

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.

Table of Contents

  • Steps
    • Open an app
    • Resovle problem
  • Advice
  • Warning

Steps

Open an app

Image titled Open Applications Using Terminal on Mac Step 1

Image titled Open Applications Using Terminal on Mac Step 1

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/6/68/Open-Applications-Using-Terminal-on-Mac-Step-1-Version-3.jpg/v4-728px- Open-Applications-Using-Terminal-on-Mac-Step-1-Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/6/68/Open-Applications- Using-Terminal-on-Mac-Step-1-Version-3.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-1-Version-3.jpg”,”smallWidth”:460 ,”smallHeight”:346,”bigWidth”:728,”bigHeight”:548,”licensing”:”<div class=”mw-parser-output”></div>”}
Launch Terminal. Find Terminal in Applications → Utilities → Terminal . You can also open Terminal using the spotlight in the upper right corner.
Image titled Open Applications Using Terminal on Mac Step 2

Image titled Open Applications Using Terminal on Mac Step 2

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/05/Open-Applications-Using-Terminal-on-Mac-Step-2-Version-3.jpg/v4-728px- Open-Applications-Using-Terminal-on-Mac-Step-2-Version-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/05/Open-Applications- Using-Terminal-on-Mac-Step-2-Version-3.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-2-Version-3.jpg”,”smallWidth”:460 ,”smallHeight”:344,”bigWidth”:728,”bigHeight”:545,”licensing”:”<div class=”mw-parser-output”></div>”}
Open the app anywhere. Normally, the open command will ask you to enter the full path of the file in the current directory. However, when you add -a after the name of the application, Terminal will immediately open the application, the file location does not matter. Such as:

  • To open iTunes, type:
    open -a iTunes
  • Use double quotes if the application name contains spaces:
    open -a “App Store”
Image titled Open Applications Using Terminal on Mac Step 3

Image titled Open Applications Using Terminal on Mac Step 3

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/01/Open-Applications-Using-Terminal-on-Mac-Step-3.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-3.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/01/Open-Applications-Using-Terminal-on-Mac- Step-3.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-3.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight” :548,”licensing”:”<div class=”mw-parser-output”></div>”}
Open the file with a specific software. You can also use this command to actively open certain types of files with the default application. Just type the path, followed by -a and the application name. If you are not sure how to enter the file path, see the Troubleshooting section below.

  • For example, you can open a .doc file with TextEdit:
    open Downloads/Instructions.doc -a TextEdit
Image titled Open Applications Using Terminal on Mac Step 4

Image titled Open Applications Using Terminal on Mac Step 4

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/c/cf/Open-Applications-Using-Terminal-on-Mac-Step-4.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-4.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/c/cf/Open-Applications-Using-Terminal-on-Mac- Step-4.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-4.jpg”,”smallWidth”:460,”smallHeight”:348,”bigWidth”:728,”bigHeight” :551,”licensing”:”<div class=”mw-parser-output”></div>”}
Add additional options. Type info open to see a full list of additional options for the open command. (Once done, press Contrp C to return to the command line.) Here are some basic examples:

  • 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
READ More:   How to Unlock iPhone Without Passcode
Image titled Open Applications Using Terminal on Mac Step 5

Image titled Open Applications Using Terminal on Mac Step 5

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/7/79/Open-Applications-Using-Terminal-on-Mac-Step-5.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-5.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/7/79/Open-Applications-Using-Terminal-on-Mac- Step-5.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-5.jpg”,”smallWidth”:460,”smallHeight”:348,”bigWidth”:728,”bigHeight” :551,”licensing”:”<div class=”mw-parser-output”></div>”}
Add -F to open a “new” copy of the application. Your unsaved changes will be lost, however, this can be useful if opening a document causes the application to freeze:

  • open -F -a TextEdit
Image titled Open Applications Using Terminal on Mac Step 6

Image titled Open Applications Using Terminal on Mac Step 6

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/2/24/Open-Applications-Using-Terminal-on-Mac-Step-6.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-6.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/2/24/Open-Applications-Using-Terminal-on-Mac- Step-6.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-6.jpg”,”smallWidth”:460,”smallHeight”:346,”bigWidth”:728,”bigHeight” :547,”licensing”:”<div class=”mw-parser-output”></div>”}
Open multiple windows of the same application by adding -n. This is suitable for comparing different levels of access, or if the application allows only one window to be opened. For example, type this command multiple times to open multiple windows of the alarm program:

  • 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.
Image titled Open Applications Using Terminal on Mac Step 7

Image titled Open Applications Using Terminal on Mac Step 7

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/c/cb/Open-Applications-Using-Terminal-on-Mac-Step-7.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-7.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/c/cb/Open-Applications-Using-Terminal-on-Mac- Step-7.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-7.jpg”,”smallWidth”:460,”smallHeight”:343,”bigWidth”:728,”bigHeight” :543,”licensing”:”<div class=”mw-parser-output”></div>”}
Run the application in Terminal. Instead of just opening an application as usual, Terminal also has the ability to control. This feature is suitable for handling error messages or control information that the computer gives on the Terminal window. Proceed as follows: [1] X Research Source

  • 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

Image titled Open Applications Using Terminal on Mac Step 8

Image titled Open Applications Using Terminal on Mac Step 8

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/a/ab/Open-Applications-Using-Terminal-on-Mac-Step-8.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-8.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/a/ab/Open-Applications-Using-Terminal-on-Mac- Step-8.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-8.jpg”,”smallWidth”:460,”smallHeight”:343,”bigWidth”:728,”bigHeight” :543,”licensing”:”<div class=”mw-parser-output”></div>”}
Find the application name. If Terminal gives an error “Unable to find application named…,” (Cannot find application named…), determine the exact name of the application by browsing the program list alphabetically. pcs: [2] X Research Source

  • 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.
READ More:   How to Get Along With Your Sister
Image titled Open Applications Using Terminal on Mac Step 9

Image titled Open Applications Using Terminal on Mac Step 9

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/c/ce/Open-Applications-Using-Terminal-on-Mac-Step-9.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-9.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/c/ce/Open-Applications-Using-Terminal-on-Mac- Step-9.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-9.jpg”,”smallWidth”:460,”smallHeight”:343,”bigWidth”:728,”bigHeight” :543,”licensing”:”<div class=”mw-parser-output”></div>”}
Understanding absolute paths. If Terminal says “the file … does not exist,” (the file … does not exist), you have entered the wrong path. The easiest way to avoid this mistake is to drag the file from the Finder folder and drop it into the Terminal command line (after typing “open,” drop the file and press Enter.) The absolute path of the file will be entered and adjusted. heading to the right place.

  • 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).
Image titled Open Applications Using Terminal on Mac Step 10

Image titled Open Applications Using Terminal on Mac Step 10

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/d/da/Open-Applications-Using-Terminal-on-Mac-Step-10.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-10.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/d/da/Open-Applications-Using-Terminal-on-Mac- Step-10.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-10.jpg”,”smallWidth”:460,”smallHeight”:351,”bigWidth”:728,”bigHeight” :555,”licensing”:”<div class=”mw-parser-output”></div>”}
Understanding relative paths. The start of a Terminal command is always the current directory you are in. By default, the root directory name will come after your username. A relative path will start with a ./ or a regular character, meaning the file is located in a location relative to the directory you’re accessing. [3] X Research Source If still having trouble, follow these steps:

  • 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.)
Image titled Open Applications Using Terminal on Mac Step 11

Image titled Open Applications Using Terminal on Mac Step 11

{“smallUrl”:”https://www.wikihow.com/images_en/thumb/9/90/Open-Applications-Using-Terminal-on-Mac-Step-11.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-11.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/9/90/Open-Applications-Using-Terminal-on-Mac- Step-11.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-11.jpg”,”smallWidth”:460,”smallHeight”:345,”bigWidth”:728,”bigHeight” :546,”licensing”:”<div class=”mw-parser-output”></div>”}
Convert directory. You can return to the original directory with the command cd ~/ , or move to a lower directory by adding “cd” to the directory name — for example, cd Documents/Finances . Note, the file you are opening must be in the current directory, however, even if the location is unknown, we can still proceed to open the file with the application.
  • Image titled Open Applications Using Terminal on Mac Step 12

    READ More:   How to Make a Wedding Bouquet

    Image titled Open Applications Using Terminal on Mac Step 12

    {“smallUrl”:”https://www.wikihow.com/images_en/thumb/0/09/Open-Applications-Using-Terminal-on-Mac-Step-12.jpg/v4-728px-Open-Applications- Using-Terminal-on-Mac-Step-12.jpg”,”bigUrl”:”https://www.wikihow.com/images/thumb/0/09/Open-Applications-Using-Terminal-on-Mac- Step-12.jpg/v4-728px-Open-Applications-Using-Terminal-on-Mac-Step-12.jpg”,”smallWidth”:460,”smallHeight”:343,”bigWidth”:728,”bigHeight” :543,”licensing”:”<div class=”mw-parser-output”></div>”}
    Find the right file. The file name must include the extension . If the extension is hidden, you can use one of the following methods to determine it:

    • 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.
    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:

    Related Posts

    How to Create Curved Text in Photoshop
    How to fall asleep faster
    How to Install FBReader to Read eBooks

    Category: How To

    Previous Post: « How much lychee 1 kg? Where to buy lychee with good price in HCMC?
    Next Post: World Environment Day June 5: History, meaning, themes »

    Copyright © 2025 · Tnhelearning.edu.vn - Useful Knowledge