Emacs: Difference between shell, term, eshell

By Xah Lee. Date: . Last updated: .

Emacs has many shell commands. Here's their differences:

shell is the standard emacs interface to Operating System's command line interface. [see Emacs: Run Shell in Emacs]

term is a terminal emulator. It behaves like a dedicated terminal app, such as {xterm, gnome-terminal, puTTY}. It is compatible to more shell apps than emacs shell interface, but standard emacs keys such as moving cursor doesn't work here.

ansi-term is pretty much same to term today. They were different packages, but now both defined in term.el

eshell is a shell written entirely in emacs lisp. Note: it is not a bash emulator. Eshell is a shell by itself, but similar to bash or other shells. [see Emacs: M-x eshell]

emacs eshell 2014-10-18
emacs eshell

Which should you use?

It depends on your preference.

But the following is some general guide.

shell is the most popular. It is good for general use of classic/standard unix shell commands, such as {grep, du, ls, sort, cat, head, tail, uname, …}. [see Linux Tutorial by Example: Most Frequently Used Shell Commands]

term and ansi-term are good if you want to run stuff like ssh, or other command line interactive interface (such as {python, ruby, lisp} shell), or text based GUI app such as vim.

eshell is good especially on Microsoft Windows where bash is not installed. Eshell is also super fast on startup. If you are a emacs lisp programer, you might prefer eshell because direct access to emacs lisp and better integration with emacs.

Personally, i used shell from 1998 to 2013, and eshell now. But i always have a real terminal app open, for running any command i'm not familiar with. For any serious command, such as starting a server, or any command that has logs, i run it in a real terminal app, with no tie to emacs.

Shell Topic

  1. Emacs: Run Shell in Emacs
  2. Why Run Shell in Emacs?
  3. Emacs: Difference between shell, term, eshell
  4. Emacs: M-x eshell
  5. Emacs: View Linux man Page
  6. Emacs: Interactive Abbrev
  7. Emacs: File Manager, dired
  8. Emacs: Batch Rename Files
  9. Linux: Basic Shell Commands
Liket it? Put $1 at patreon. Or Buy Xah Emacs Tutorial. Thanks.