Skip to main content

Opens files, directories and applications from the command-line in macOS.

# To open a file with the associated application:
open file.ext

# To run a graphical macOS application:
open -a Application

# To run a graphical macOS app based on the bundle identifier (refer to `osascript` for an easy way get this):
open -b com.domain.application

# To open the current directory in Finder:
open .

# To reveal a file in finder:
open -R path/to/file

# To open all the files of a given extension in the current directory with the associated application:
open *.ext