How to Open Apps Using Terminal on Mac

Open an app

How to Open Apps Using Terminal on Mac Picture 1

Launch Terminal. Find Terminal in Applications → Utilities → Terminal. You can also open Terminal using spotlight in the upper right corner.

How to Open Apps Using Terminal on Mac Picture 2

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 quotes if the app name has spaces:
open -a "App Store"

How to Open Apps Using Terminal on Mac Picture 3

Open the file with a specific software. You can also use this command to actively open certain file types using the default application. Just type the path, followed by -a and the application name. If you're unclear about entering file paths, see the Troubleshooting section below.

For example, you can open a .doc file with TextEdit:
open Downloads/Instructions.doc -a TextEdit

How to Open Apps Using Terminal on Mac Picture 4

Add additional options. Type info open to see a complete list of additional options for the open command . (After viewing, click ControlCto 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 app running in the background so you can continue working in Terminal:
open -g -a iTunes

How to Open Apps Using Terminal on Mac Picture 5

Add -F to open a "new" copy of the application. Your unsaved changes will be lost, but this can be useful if opening a document causes the previous application to freeze:

open -F -a TextEdit

How to Open Apps Using Terminal on Mac Picture 6

Open multiple windows of the same application by adding -n. This is suitable for comparing different levels of access, or if the application only allows one window to be open. For example, enter 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 are correlated with their own copies, it can cause unexpected problems.

How to Open Apps Using Terminal on Mac Picture 7

Run the application in Terminal. Instead of just opening an application as usual, Terminal also has control capabilities. This feature is suitable for handling error messages or control information that the computer displays on the Terminal window. Proceed as follows:

Locate the application in Finder.

Right-click the application and select "Show Package Contents".

Locate the executable file. Typically, the file will be in Contents → MacOS and have the same content as the application.

Drag the file and drop it onto the empty Terminal command line. Press Enter to run the program.

While using the program, you need to leave the Terminal window open. When you exit the application, Terminal will return to normal mode.

Resovle problem

How to Open Apps Using Terminal on Mac Picture 8

Find the application name. If Terminal reports the error "Unable to find application named.," determine the exact name of the application by browsing the alphabetical list of programs. female:

Click the apple icon in the upper left corner of the screen.

Hold down the key ⌥ Optionand click System Information in the drop-down menu.

In the left bar of the System Information window, click Software → Applications. It will take a few minutes for this list to appear.

How to Open Apps Using Terminal on Mac Picture 9

Understanding absolute paths. If Terminal says "the file . does not exist," it means you 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 in 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).

How to Open Apps Using Terminal on Mac Picture 10

Understand relative paths. The beginning of a Terminal command is always the current directory you are in. By default, the root folder name will be after your username. A relative path will start with ./ or a regular character, meaning the file is located relative to the directory you are accessing. If you're still having trouble, follow these steps:

Enter pwd to check the current directory. The file you want to open must be within this directory and not in a higher branch.

Locate your current folder in Finder. Open a series of folders until you find the file you want to open.

Enter the name of the folder you want to open, separated by / and then ending with the file name. For example, open Documents/Writing/Novel/ch3.pdf. (If you put ./ before Documents, it will still produce the same result.)

How to Open Apps Using Terminal on Mac Picture 11

Convert folders. You can return to the root directory with cd ~/, or move to a lower directory by adding 'cd' after 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 cannot be determined, we can still proceed to open the file with the application.

How to Open Apps Using Terminal on Mac Picture 12

Find the right file. The file name must include the extension at the end. If the extension is hidden, you can use one of the following methods to identify it:

Select the file in Finder. Press ⌘ Command+ I. On the Info window, look for "file name & extension" to see the full name.

Or , go to the folder containing the file. Enter ls into the Terminal command line to list the files in the directory.

Another way is to drag and drop the file into the Terminal window.

5 ★ | 2 Vote

May be interested

  • How to set Windows Terminal to always open with Command Prompt on Windows 11How to set Windows Terminal to always open with Command Prompt on Windows 11
    windows terminal is a great application on windows 11 for you to access operating system commands. windows terminal is a powerful all-in-one solution for programmers as well as professional users.
  • How to Get to the Command Line on a MacHow to Get to the Command Line on a Mac
    this wikihow teaches you how to open the terminal (command prompt) application in macos using launchpad, spotlight, or finder. terminal gives you access to the unix part of macos so you can manage files, edit settings, and run scripts...
  • How to Open a Terminal Window in MacHow to Open a Terminal Window in Mac
    this wikihow teaches you how to open the terminal utility on mac, which provides mac users with a way to access and adjust settings of the operating system with text-based commands. click the finder icon in your dock. it's a square icon...
  • How to Install Windows Terminal on Windows 10How to Install Windows Terminal on Windows 10
    windows terminal is an open source application that allows you to open multiple console tabs in the same window.
  • 6 interesting terminal commands on Mac6 interesting terminal commands on Mac
    terminal is a handy utility, often found on unix-based computers, such as linux and macos. there are many interesting things to do in the terminal. regardless of your experience, you can use these great terminal commands on mac.
  • How to Change How Often a Mac Screen Saver ChangesHow to Change How Often a Mac Screen Saver Changes
    this wikihow teaches you how to change how often the screensaver on your mac cycles from image to image. you can do it using terminal, which comes built into your mac. open terminal. you can type 'terminal' into spotlight search to access...
  • How to add / remove 'Open in Windows Terminal' context menu in Windows 10How to add / remove 'Open in Windows Terminal' context menu in Windows 10
    once you have windows terminal installed, it will add the open in windows terminal entry to the right-click menu of folders in file explorer. if you are not satisfied with this option, here's how to remove it from the context menu.
  • Windows Terminal adds a tool to edit hidden graphics settingsWindows Terminal adds a tool to edit hidden graphics settings
    windows terminal is an open source application developed by microsoft that allows you to open multiple console tabs in the same windows. each of these dashboard tabs can be used for different shells.
  • How to install Hyper Terminal in Ubuntu 20.04How to install Hyper Terminal in Ubuntu 20.04
    hyper is an open source application supported on all three major platforms: windows, linux, and macos. in this tutorial, tipsmake.com will explain how to install hyper terminal in ubuntu system.
  • How to Launch Programs from Command Line on LinuxHow to Launch Programs from Command Line on Linux
    most linux distributions have a graphical user interface that allows us to open programs just by clicking on the program icon in the apps menu. however, sometimes you may want to launch programs from terminal. terminal is a powerful tool that allows users to launch programs and manage linux systems through keyboard commands. today's tipsmake will show you how to launch programs from terminal on linux.