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.

How to open a file from bash command line in the already open Emacs instead of a new instance? When I type

$ emacs file.txt

it opens a new Emacs instance, instead of opening the file in the existing Emacs instance. Mac OS X 10.6.8. and

GNU Emacs 23.4.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)

of 2012-02-27 on beta.macosforge.org

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

what you are looking for is emacs server mode. Add this line to your .emacs file:


Then, open the file using emacsclient:

emacsclient foobar.txt

Have a look at this page for more information.

share|improve this answer
add comment

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.