≡ Menu

How to Install and Launch emacs Editor on Debian / Ubuntu Linux

We are Vim editor fans. Vim editor is the most popular editor for UNIX / Linux platform, followed by emacs editor. If you talk to emacs editor fans, they might think otherwise.

In the spirit of learning, we’ve decided to explore emacs editor in detail and we’ll be posting several emacs articles in the upcoming weeks.

In this article, let us review how to install Emacs editor on Ubuntu / Debian. We’ll also see how to do the basic operation of opening and saving a file in Emacs editor.

1. Installing emacs Editor on Ubuntu / Debian

$ sudo apt-get install emacs

Check the version of installed emacs editor as shown below.

$ emacs --version
GNU Emacs 22.2.1
Copyright (C) 2008 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

2. Launch emacs Editor in GUI Mode

Type emacs at the command line to open the emacs GUI editor.

$ emacs testfile

Fig: Emacs editor in GUI mode (click on the image to enlarge)

You can save and close the file using the menus available.

3. Launch emacs Editor in Text Mode

By default emacs will open in the GUI mode. Use -nw option ( no window ), to open emacs editor in text mode as shown below.

$ emacs -nw testfile

Fig: Emacs editor in Text Mode (click on the image to enlarge)

Save File and Exit Emacs Editor

If you are new to emacs editor, following are two things you should know.

  • Save the file using CTRL-X CTRL-S
  • Exit the editor using CTRL-X CTRL-C
Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • yoander July 12, 2010, 3:28 pm

    Installing emacs without gui:
    sudo apt-get install emacs-nox

  • Kevin Cline November 15, 2012, 4:11 pm

    22.3 is pretty old. Need instructions for downloading and building from source.