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

by SathiyaMoorthy on July 2, 2010

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

Linux Sysadmin Course Linux provides several powerful administrative tools and utilities which will help you to manage your systems effectively. If you don’t know what these tools are and how to use them, you could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to help you understand system administration tools, which will help you to become an effective Linux system administrator.
Get the Linux Sysadmin Course Now!

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

{ 2 comments… read them below or add one }

1 yoander July 12, 2010 at 3:28 pm

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

2 Kevin Cline November 15, 2012 at 4:11 pm

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

Leave a Comment

Previous post:

Next post: