The open command can be used to open files and directories, and to launch applications from the Terminal application.
application to open the file.
Specifes the application to open the file with, as identified with
identifier. For example, to open a CSV-format file names.csv with Excel, use open -b com.microsoft.Excel names.csv.
Force the use of Mac OS X's TextEdit application to open the specified
Read input from standard input and open the text in TextEdit.
file with the default text editor, which may not be TextEdit.
To open a directory in the Finder, use open, followed by the name of the directory. For example, to open the current directory, type:
To open your Public folder in the Finder:
To open the /Applications folder in the Finder:
To open an application, you need only its name. For example, you can open Xcode (/Developer/Applications) with this command:
open -a Xcode
You aren't required to enter the path for the application—only its name—even if it is a Classic application. The only time you are required to enter the path is if you have two different versions of an application with similar names on your system.
You can also supply a filename argument with the -a option, which launches the application and opens the specified file with that application. You can use this option to open a file ...