Mac OS X

open [-a application] filename

Just calling "open filename" will run the default application for the file type. Passing the -a parameter with the application to start will open the file in it, e.g.

open -a textedit.app filename