This content originally appeared on DEV Community and was authored by Aishwary Gathe
There’s a moment every Linux user encounters. You open a file in the terminal — maybe because a tutorial told you to — and suddenly, you’re inside an editor. The cursor is blinking. You try typing, but nothing happens. You panic, mash keys, and finally escape with :q!
, relieved but confused.
If you’ve ever been there — welcome. You’ve just met the mysterious world of Linux file editors, where every keystroke holds meaning, and every action is deliberate.
But what if I told you these tools, intimidating as they may seem, are some of the most powerful assets you’ll ever have on a Linux system?
In this post, we’re going to walk a path — from beginner to confident user — across the most essential Linux file editors: vi, vim, ed, ex, emacs, and pico. You’ll not only understand how to use them, but also why they work the way they do.
Why Learn Terminal Editors at All?
Let’s get real: why not just open VS Code or nano and move on?
Here’s why:
- You won’t always have a GUI.
- You’re often SSH-ed into remote servers with minimal tools.
- Some environments (like Docker containers or minimal Linux distros) have only
vi
ored
. - Speed, flexibility, and sheer power.
The better you get with these tools, the faster and more effective you’ll be on any system, anywhere.
Getting Started: Opening a File
To edit a file using any of these editors, you just type the editor’s name followed by the filename:
vi notes.txt
vim config.ini
ed server.conf
emacs report.md
pico todo.txt
If the file doesn’t exist, it will be created. If it does, you’ll be dropped straight into edit mode (or some version of it).
A Quick Look at the Editors
1. Vi – The original, lightweight, always-present
- Found on nearly every Linux system.
- Modal editor (command vs insert mode).
- Super fast once you get used to the keybindings.
2. Vim – Vi Improved
- Everything vi has + tons of extras (syntax highlighting, plugins).
- Ideal for developers and power users.
- Most tutorials and cheat sheets are written with Vim in mind.
3. Ed – The line editor
- Minimal. Text editing without showing the file.
- Great for scripting or ultra-light environments.
- You probably won’t use it daily — but good to know it exists.
4. Ex – Ed’s big brother and the command-line backend of vi
- Works similarly to ed, but more powerful.
- Used in scripting or from within vi/vim for complex operations.
5. Emacs – A world of its own
- Not just an editor — it’s practically an operating system.
- Highly customizable, supports everything from version control to email.
- Steeper learning curve, but a favorite for many hardcore developers.
6. Pico – Simple and beginner-friendly
- Created for Pine email but used as a general editor.
- No modes. Just point, type, and go.
- If you’re a nano fan, pico will feel familiar.
Let’s Get Hands-On: Vim Essentials (Vi Works the Same Way)
You Open a File:
vim notes.txt
And then… nothing seems to happen. That’s because you’re in command mode.
Here’s your survival guide:
Switching Modes
Key | Action |
---|---|
i |
Insert mode (start typing) |
Esc |
Exit insert mode to command |
a |
Insert after cursor |
O |
Open a new line above |
Editing
Command | Action |
---|---|
dd |
Delete entire line |
x |
Delete character under cursor |
X |
Delete character before cursor |
r |
Replace single character |
u |
Undo last change |
U |
Undo changes on current line |
Searching
Command | Action |
---|---|
/word |
Search forward for ‘word’ |
?word |
Search backward |
n |
Repeat last search forward |
N |
Repeat last search backward |
Saving and Exiting
Command | Action |
---|---|
:wq |
Write and quit |
:q! |
Quit without saving |
ZZ |
Save and quit (Shift + Z twice) |
Real-World Scenarios Where These Editors Matter
1. You SSH into a remote server and need to edit a config file
- GUI tools? Gone.
- FTP client? Not set up.
-
vi nginx.conf
— and you’re in.
2. A script breaks in production
- You’re in a recovery shell with only
ed
. - Knowing
ed
commands means you can fix a config file line-by-line.
3. You’re building Docker images
- Minimal containers only include
vi
. - Learning
vim
means never feeling stuck or blocked.
Tips to Build Muscle Memory
-
Practice on non-critical files: Open a
.txt
file and just try deleting lines, moving around, typing. - Use cheat sheets: Stick a printed Vim reference near your monitor.
-
Challenge yourself: Edit your
.bashrc
or.gitconfig
with Vim for a week. - Set daily “vim drills”: For 5 minutes a day, open Vim and practice 3 commands.
The point isn’t to memorize everything immediately — it’s to feel less lost every time you open the editor.
Why It’s Worth It
These editors feel old-school — but they were built by people who understood something critical: speed matters. When you stop fighting the tool and start dancing with it, you can fly through text at a pace you didn’t think possible.
Text editing becomes art. Muscle memory kicks in. And every keystroke saves you time.
Final Thoughts: You’re Not Just Editing Files — You’re Leveling Up
Learning Linux file editors is one of those rare skills where the deeper you go, the more it gives back. You don’t just become more productive — you become more self-reliant, more adaptable, and more capable of solving problems in real-time.
It’s not about being a terminal wizard from day one. It’s about building confidence one keystroke at a time.
So go ahead — open that config file. Type i
, write a few lines, press Esc
, and save with :wq
.
You just leveled up.
From The Learners Den
Aishwary Gathe
This content originally appeared on DEV Community and was authored by Aishwary Gathe