MacOS – Opening TextEdit Files from Terminal

command linemacosterminaltextedit

I frequently find that a Terminal command to open a file in TextEdit would be very handy. Does such a command exist on Mac OS X?

Best Answer

open -a TextEdit filename should do the trick.

The -a flag specifies any application you want, so it's applicable to any number of situations, including ones where TextEdit isn't the default editor.

Other relevant options

  • -t opens in the default editor (i.e. if you use BBEdit, TextMate, etc.)
  • -e will open the file specifically in TextEdit