Home OS X
OS X Syntax

open

Open a file or folder.
The open command opens a file (or a folder or URL), just as if you had double-clicked the file's icon.

SYNTAX
            open [-a application] file ...

            open [-e] file ...

OPTIONS
       -a     Specify the application to use for opening the file

       -e     Edit the file (with /Applications/TextEdit)

If no application name is specified, the default application as determined via LaunchServices is used to open the specified files.
You can specify one or more file names (or pathnames), which are interpreted relative to the shell or Terminal window's current working directory. e.g. open *.doc

EXAMPLES

Open demo.txt in the default application (as determined by LaunchServices).
   'open /Volumes/Macintosh HD/demo.txt' 
   or
   'open file://localhost/Volumes/Macintosh HD/demo.txt' 

Open a folder in the Mac  Finder.
   'open /Volumes/Macintosh HD/Applications/'
   Or
   'open file://localhost/Volumes/Macintosh HD/Applications/'

Open demo.txt with a specific application (in this case, TextEdit).
   'open -a /Applications/TextEdit.app /Volumes/Macintosh HD/demo.txt'

Open a URL 
   'open http://www.ss64.com/'

Edit demo.txt (will open in TextEdit)
   'open -e /Volumes/Macintosh HD/foo.txt'

"Clothes make the man. Naked people have little or no influence on society" - Mark Twain

Related commands:

lesskey -
echo - Display message on screen
tee - Redirect output to multiple files

The less home page (Mark Nudelman)

Equivalent BASH command:

less
- Page through text one screenful at a time



Back to the Top

Simon Sheppard
SS64.com