On Mac OS X, the command open FILE
will perform the same action as double-clicking the file in Finder. If it is not working, it's because the file type needs to be associated with the application:
- Select the file in Finder.
- Select "Get Info" from the File menu.
- In the "Open with:" section, pick the application you want.
- Optionally, click "Change All..." to use that app for all files with same extension.
Afterward, open
will launch that app with that file.
If you don't want to change the type, you can also tell the open
command which app to use:
open -a "App Name" FILE
Type man open
to see the manual page which will explain in more detail how it works.