Name

open — stdin  stdout  - file  -- opt  --help  --version

Synopsis

open [options] [files] [--args application_arguments] 

The open command opens the given files with whatever application is registered to do so. For example, open myfile.txt runs TextEdit, open spreadsheet.xls launches Microsoft Excel or Apple’s Numbers, and open /Users/smith/Documents opens the Finder to display that folder. The application launches in the background so you get your shell prompt back.

You can also open a URL, launching your default web browser:

open http://www.apple.com

Useful options

-a app

Open the files with the given application app instead of the default one. If you omit the filename after -a, the application is simply launched.

-e

Open with TextEdit.

-f

Read from standard input into your default text editor. Useful as the last step of a shell pipeline.

-W

Open the application in the foreground for the shell. By default, it opens in the background so you get your shell prompt back.

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.