When in a Linux terminal, what is the difference between typing emacs-x and emacs?

  • I'm taking a shot in the dark here, I'm totally just guessing so I won't post this as an answer. There might not be any difference. Maybe emacs used to run on a terminal by default, and emacs-x was the command that ran it in a separate window with a gui. Eventually the default behavior of emacs was changed to running on a separate window, and thus the two commands became identical. – Malabarba Jun 17 '10 at 17:18

Under debian I have:

% ls -l /usr/bin/emacs
lrwxrwxrwx 1 root root 23 25 sept.  2009 /usr/bin/emacs -> /etc/alternatives/emacs
% ls -l /etc/alternatives/emacs
lrwxrwxrwx 1 root root 18 25 sept.  2009 /etc/alternatives/emacs -> /usr/bin/emacs23-x

showing that emacs is realy emacs23-x. Probably, on your system, you will see that emacs is realy emacs-x. The use of symlink give the opportunity to the admin of your box to choose which Emacs is the default one, and the presence of the others executable enable the users of your box to choose which of the installed Emacs they want to run.

| improve this answer | |

What actually happens can be different depending on your distribution and system configuration. A pretty easy way to figure out for sure what is going on is first checking for any aliases:

alias | grep emacs

That should show you if you have any aliases defined for emacs or emacs-x. Next I would run:

which emacs
which emacs-x

which will give you the path the executable that is run when you type that command.

Edit: Looking at the changelog for the Emacs rpm, see the change made on Mon Apr 11 2005.

  • suffix the X emacs binaries with -x and the no X binaries with -nox

Looks like it is just an version of emacs capable to run in an X environment.

| improve this answer | |
  • nothing is output for "alias | grep emacs". for "which emacs-x", "/usr/bin/emacs-x"; for "which emacs", "/usr/bin/emacs". Not know what is the difference between the two from these – Tim Feb 3 '10 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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