Guide to Using Emacs Editor (Linux)
What Will You Learn in This Guide?
In this guide, you will learn what Emacs is, why it is preferred and how to install it on Ubuntu 22.04.
You will also see basic commands such as opening a file, saving, exiting, navigating the text, search-replace, capitalization and switching to the mode system.
Note: The guide is compatible with Ubuntu 22.04 Cloud Server instances on GenixNode.
1. What is Emacs?
Emacs is one of the most powerful and customizable text editors in the GNU ecosystem.
Thanks to its mod system, Python can act as an IDE for languages such as C and Java.
It is positioned in between, as it is as user-friendly as Nano and as powerful as Vim.
2. Requirements
- An Ubuntu 22.04 Instance running on GenixNode
Example: tr1-node01 - A non-root user with authority
sudo - Firewall must be enabled
3. Installing Emacs
First check if Emacs is installed on the system:
emacs
If not installed, install:
sudo apt install emacs
After the installation is completed:
emacs
You can start the editor by typing .
4. Emacs Interface
When Emacs opens, there are three basic areas:
✔ Main Buffer
It is the area where you type or display text. Any changes you make to the file are first saved to the buffer memory, not to disk.
✔ Status Bar (Mode Line)
File name, cursor position, active mode, file status are shown.
-- → saved
** → there are unsaved changes
%% → read-only
✔ Mini Buffer: This is the lower part where commands are processed. File opening, searching, mode changing, reminder messages appear here.
5. Opening and Saving Files
To open a new file or existing file:
C-x C-f
To save:
C-x C-s
To exit:
C-x C-c
6. Command Keys (CTRL & META Logic)
C- → CTRL
M- → ALT/ESC (Meta)
RET → Enter
Examples: C-x C-c → CTRL+X then CTRL+C M-x → ALT+X (or ESC then X)
7. Navigating Within Text
| Function | Shortcut |
|---|---|
| Line down | C-n |
| Line up | C-p |
| Character forward | C-f |
| Character back | C-b |
| Word forward | M-f |
| Word back | M-b |
| Carriage return | C-a |
| Line break | C-e |
| Page down | C-v |
| Page up | M-v |
| per file | M-< |
| End of file | M-> |
- Select, Copy, Paste Start selection:
C-SPC
Copy:
M-w
Cut:
C-w
Paste:
C-y
Delete line break:
C-k
Delete word:
M-d
Undo:
C-x u
9. Search and Replace
Advanced search:
C-s
Callback:
C-r
Replacement:
M-%
Then:
y → replace
n → skip
! → change all
10. Alignment (Justification)
Align left:
M-x set-justification-left
Align right:
M-x set-justification-right
Center:
M-x set-justification-center
11. Case Conversions
| Function | Shortcut |
|---|---|
| Word uppercase | M-u |
| Word lowercase | M-l |
| Word initial capital | M-c |
| Region uppercase | C-x C-u |
| Region lowercase | C-x C-l |
12. Window Management
Change buffer:
C-x b
Split the window in two:
C-x 2
Close window:
C-x 0
Back to single window:
C-x 1
13. Switching to Modes (Major / Minor Modes)
✔ Major Modes
It turns Emacs into an IDE for a programming language.
Examples:
python-mode
c-mode
text-mode
html-mode
When you open a Python file, it becomes active automatically:
emacs hello.py
Mode switching:
M-x python-mode
✔ Minor Modes
They are small feature modes that work in an on/off manner.
Examples:
auto-fill-mode
auto-save-mode
linum-mode
column-number-mode
Activate:
M-x auto-fill-mode
📌 FAQ – Frequently Asked Questions
1. What happens if I don't save when logging out of Emacs?
Emacs asks. Save with y, exit without saving with n.
2. Emacs or Vim?
Emacs is more extensible, Vim is faster. Varies depending on usage.
3. How do I access the menus?
In Terminal Emacs, the menu opens with F10.
4. How do I select a paragraph?
You can select the paragraph you are in with M-h.
5. Can Emacs really be used as an IDE?
Yes. It offers a full IDE experience thanks to mod support in languages such as Python, C and Java.
🚀 Conclusion and Recommendation
With this guide, you learned the basic installation of Emacs, text editing commands and mod system. For more advanced use, the GNU Emacs documentation and Emacs Wiki are very useful.
You can try Emacs on your Ubuntu servers on GenixNode now.

