Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I used sudo apt-get install emacs to download emacs. I expected the command-line emacs to start when I ran emacs but instead the GUI emacs started.

How can I download the command-line emacs?

share|improve this question

4 Answers 4

up vote 23 down vote accepted

The command-line emacs is installed along with the GUI.
To run it, use the -nw option. An explanation from man emacs:

-nw, --no-window-system
Tell Emacs not to use its special interface to X. If you use
this switch when invoking Emacs from an xterm(1) window, display
is done in that window.

So run the following command to use emacs from the command-line:

emacs -nw

enter image description here

If you don't want to have to type emacs -nw, you could create an alias. Put the following line in your ~/.bashrc or ~/.bash_aliases:

alias emacs="emacs -nw"

You can add this alias in one line by using I/O Redirection:

echo alias emacs="emacs -nw" >> ~/.bashrc
share|improve this answer
4  
Or, you could do that. Wait, you actually use emacs? I would have answered this more quickly but I was stuck typing ^X^C^Q^X, etc. –  belacqua Jan 28 '11 at 5:42
    
@jgbelacqua Actually I use vim :P –  Alvin Row Jan 28 '11 at 5:43
    
Ah, me too. Sometimes just /bin/vi to be a masochist. Oh, wait. Don't have that anymore. Have to turn on masochist mode manually. –  belacqua Jan 28 '11 at 5:46

That would be emacs22-nox I believe.

Description: The GNU Emacs editor (without X support)

So, just as before but with that package:

sudo apt-get install emacs22-nox

For cases like this, where you wonder what's in what package, try this :

apt-cache search ^emacs 

then

 apt-cache show <whateverpackage>
share|improve this answer
    
"sudo apt-get install emacs24-nox" did work for me. –  Achmed Durangi Oct 25 '13 at 11:57
    
Stephan - try emacs23-nox. Its still a big package at 26MB download/78MB on disk. –  noloader Dec 26 '13 at 1:42

You already have installed it.

Just run emacs with:

emacs -nw
share|improve this answer

I think I accidentally downgraded a post without intending to. emacs -nw is the correct option.

I just get tired of the vi/emacs flame warz. If the original post didn't mention vi, then mentioning vi doesn't help.

Besides, emacs has a vi mode in it - viper-mode.

share|improve this answer

Your Answer

 
discard

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.