opening files from terminal
# -a lets you pass an application name to open with
open -a TextEdit ~/path/to/foo.txt
# -e will open the file in TextEdit
open -e ~/path/to/foo.txt
# -t opens the file with the default text editor
open -t ~/path/to/foo.txt