Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed "Emacs for Mac OS X" on my Mac running OS X 10.6.

My question is: how can I run it from a command line to open a file? When I do

$ emacs aFile.txt

It just uses the in window emacs, not the emacs from macosx that I installed.

Thank you.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

open -a Emacs aFile.txt should open it in the UI Emacs. That works for any Mac application, to get it fired up appropriately.

share|improve this answer
Thanks. It works, but when the file does not exit, it said "The file /Users/scheung/a.txt does not exist." how can I make emacs creates a new file name 'aFile.txt' for me? –  michael Feb 9 '12 at 5:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.