Use of the UNIX Terminal (macOS)

Home

Open a file in an app

There's a command for that: open.

Open it in the default app

This is the simplest way: you just have to type the filename.

open myFile.ext
open Main.java

Open it in a chosen app

You just have to add the name of the app preceded by -a.

Note: you have the choice to type the filename before or after the -a myApp.

open myFile.ext -a myApp
# or
open -a myApp myFile.ext
open Main.java -a atom

Alias

You can create an alias to go faster.

Example:

alias idea="open -a 'IntelliJ IDEA'"

ToolKit © 2017
About