/ factorpad.com / tech / linux-essentials / emacs-command.html
An ad-free and cookie-free website.
Beginner
Learn the basics of one of many text editors at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux emacs Command Summary with Examples (3:33)
Our fifty-sixth word, or command to memorize is
emacs
from our category
Text.
emacs
allows you to edit text files.
-options | description |
---|---|
--help |
Print help screen |
Ctrl-h r |
Internal help manual |
Ctrl-x Ctrl-c |
Internal command to quit emacs |
Recall from video 20 on nano
, our
first text editor, it offered a simple tool for quick edits, but for added
functionality, most people use a program like
emacs
, or
vim
, which we'll be introducing in our
next video (tutorial).
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s)
.
The emacs
command has
over 50 options and the argument is a text file to
edit, and because emacs
is a
full-blown text-editing program, its list of internal commands is vast.
Like most commands, help is available with double-dash. Once inside
emacs
view internal help with
Ctrl-h
then
r
. And importantly, to quit, type
Ctrl-x
then
Ctrl-c
.
So why is emacs
an important command?
Well, programmers spend lots of time in editors, memorizing commands,
and you'll need to find your go-to editor.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. Let's start with the
emacs --help
option, and redirect that
>
to a file called
video56.txt
.
Next, type emacs
and that filename
video56.txt
.
Here it is, use PgUp
and
PgDn
to scroll.
Here I only have time for a quick flyby. But there are options here, as you can see, for initializing the program (above).
Taking actions (above) and changing displays.
Okay, then, to quit, type that combination
Ctrl-x
and
Ctrl-c
.
And then one last thing, why don't we head back in
(using emacs
)
without an argument.
And this will show you an opening screen with a list of helpful resources, like manuals and a tutorial. Okay, very good.
Okay now you know how to use emacs
.
And you know the syntax for commands, options and arguments.
One last tip about the vast emacs
command. So I should mention, most people use a text editor within their
GUI, instead of the terminal. Just a quick comment there.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the emacs
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
If this quick summary was helpful, please consider subscribing to our growing YouTube Channel, following @factorpad on Twitter and the no-spam email list for content update notices.
more
command,
hit Back.vim
./ factorpad.com / tech / linux-essentials / emacs-command.html
A newly-updated free resource. Connect and refer a friend today.