open(1)

NAME
open - command-line equivalent of double-clicking to open OS X applications, files, urls, x-windows unix programs, preference panes and directories. This is an enhanced version (a superset) of Apple's open command, and (unlike Apple's version) uses a powerful and nuanced customizable command completion mechanism for the open command.

SYNOPSIS
open [ -aeFfpswxh ] [ application-name ] file ...

DESCRIPTION
The open function augments Apple's distributed open command with a super-set of functionality. It opens a file (or a directory, Preference Pane, Application, Widget or URL), just as if you had double-clicked the file's icon. The augmented version incorporates a powerful zsh command completion system. If no application name is specified, the default application as determined via LaunchServices is used to open the specified files. This works with a programmed command completion for all OS X Application names. This mechanism in turn relies on mdfind in 10.4 and above, or an up-to-date locatedb in 10.3. The distributed function enable_faster_open can be run to aid the user in taking full advantage of the open completion mechanism and ensures that it operates optimally. In 10.4 this is done with a dedicated launchd item, and in 10.3 it is done using the locatedb. If the file is in the form of a URL, the file will be opened as a URL. If the name of a PreferencePane is given with the -p flag, System Preferences will open to that pane. This works with a command completion for each installed PreferencePane. You can specify one or more file names (or pathnames), which are interpreted relative to the shell or Terminal window's current working directory. For example, the following command would open all Word files in the current working directory: open *.doc

OPTIONS

-a foo [bar]
    Opens application foo [and file bar]

-d bar
    Opens file with default application

-e bar
    Force the file bar to open with TextEdit

-f  Reads piped input and opens with TextEdit.

-F bar
    Force the file bar to open with edit function.

-p bar.prefPane
    Open named System Preferences preference pane.

-s bar
    Force the file bar to open with sudo open.

-w [foobar]
    Open the Widget named foobar

-x foo [bar]
    Force the program foo to open [file bar] with open-X11.

-h  Obtain program help info.

FILES
~/.zsh/zshapplist
    An updatable listing cache of Application names to be used for completing the open -a command. See comp_appgetter(1) and enable_faster_open(1) for further details.
_open _mac_applications _mac_files_for_application _retrieve_mac_apps _comp_appgetter enable_faster_open
    are all zsh functions that must be in the $fpath array for the elaborate _open completion system to work properly.

EXAMPLES
open -a Microsoft\ Word or open -a "Microsoft Word" opens the application named 'Microsoft Word' open -a Wor <tabkey> completes the line replacing Wor with Microsoft\ Word open -a Microsoft\ Word foo.doc opens the file 'foo.doc' using the application named 'Microsoft Word'

open -p Accounts.prefPane opens the Preference Pane 'Accounts' in 'System Preferences'

open -p Acco <tabkey> completes with ' open -p Accounts.prefPane ' open . opens a finder window in the current directory. open /Volumes/Macintosh HD/foo.txt opens the document in the default application for its type (as determined by LaunchServices).

open /Volumes/Macintosh HD/Applications/ opens that directory in the Finder.

open -a TextEdit /Volumes/Macintosh HD/foo.txt' opens the document in the application specified (in this case, TextEdit). open -e /Volumes/Macintosh HD/foo.txt opens the document in TextEdit.

open http://www.apple.com/ opens the URL in the default browser. open file://localhost/Volumes/Macintosh HD/foo.txt opens the document in the default application for its type (as determined by LaunchServices).

open file://localhost/Volumes/Macintosh HD/Applications/ opens that directory in the Finder.

HISTORY
Apple's open command first appeared in NextStep, and is distributed in OS X Darwin. The open function was written as a shell-script wrapper for Apple's open to include additional functionality, and has been incorporated, along with an elaborate set of command completions, as a zsh function in the zsh-templates package. The completions for the open command were written by Motoi Washida (Nov 12, 2004 CVS version) and subsequently modified by W. G. Scott, Wataru Kagawa and others.

AUTHORS
The open command is Copyright (c) 2001 Apple Computer, Inc. All Rights Reserved. The open shell script is a wrapper for the original open program, which remains unaltered. The open shell script (and zsh function) was written by W. G. Scott and is public domain. The _open command completion function was re-written by W. G. Scott based on that of Motoi Washida. The other functions that _open depends on were written entirely by Motoi Washida, except for comp_appgetter which was written by W. G. Scott.

SEE ALSO
open(1) open-x11(1) comp_appgetter(1) enable_faster_open(1) sudo_open(1) edit(1)