9 Best Text Editors for the Linux Command Line

Looking to edit files in the command line? These are the best editors for Linux terminal when you go all command line.
Warp Terminal

A text editor is a must-have application for any operating system. We have no dearth of good text editors on Linux. There is Gedit for quick text note down, there is VS Code for writing codes and more.

But those are all GUI-based editors. What if you need to edit files in the terminal?

Linux sysadmins need to do that on a daily basis. The average desktop Linux user may also need to edit files in the command line from time to time.

Your distribution has a terminal-based text editor installed by default. But don’t restrict yourself to just that.

Here, I have compiled a list of the best command line text editors for Linux. Feel free to experiment.

Please note that this is not a ranking list.

1. Neovim

neovim text editor
Neovim text editor

Neovim is a fork of Vim that aims to add more extensibility while simplifying it. If you’re comfortable with Vim, you will be good to go using Neovim.

The project is being actively maintained and the progress is promising so far. Of course, unless you’re acquainted with how Vim works, you may not notice the striking difference between the two.

But, overall, Neovim tries to take Vim up a notch.

How to install it?

For Ubuntu-based distros, you can simply install it by typing:

sudo apt install neovim

For other Linux distributions or platforms, you may refer to its official installation instructions to get started.

To give you a head start, I must mention that when using the terminal, you will have to type the following to launch it (instead of neovim):

nvim

2. ne – The Nice Editor

ne the nice editor
NE The Nice Editor

When compared to the classic and popular text editors, ne (the nice editor) is a good alternative that tries to offer advanced functionalities and make it easier to use them.

In other words, it’s a simpler alternative to Vim/Emacs offering you powerful features. It is being actively maintained. I tried it installing on Ubuntu 22.04 and it worked just fine. You can explore more about it on their GitHub page.

Of course, unless you test it extensively, you should take it with a pinch of salt.

How to install it?

You should find it available in the official repositories of your Linux distribution. For Ubuntu-based distros, you can install it using the command:

sudo apt install ne

You can also check out their official download page for more information on other Linux distributions.

3. Vim

vim text editor
Vim text editor

If you’ve been on Linux for quite some time, you must have heard about Vim. Vim is an extensively configurable, cross-platform, and highly efficient text editor.

It may not be suitable for newbies but it’s something every aspiring Linux System administrator should get comfortable with. You will probably find it pre-installed in your Linux distribution. It is extremely popular for its wide range of advanced features.

Vim can be quite agonizing for first-time users. I remember the first time I tried to edit a text file with Vim, I was completely puzzled. I couldn’t type a single letter on it and the funny part is, I couldn’t even figure out how to close this thing. If you are going to use Vim, you must be determined to climb up a very steep learning curve.

But after you have gone through all that, combed through its official documentation, and practice the commands/operations, you’ll find it worth all the time spent. Not to forget, you can use it for basic text editing or leverage its support for hundreds of programming languages, extensions, and file formats.

How to install it?

If you don’t have it installed already, you can just try typing in the command (on Debian-based systems) to install it:

sudo apt install vim

You can also find it listed in your software center of the Linux distribution you use. In either case, just head on to its official download page to get more details.

Mastering Vim Quickly - Jovica Ilic
Exiting Mastering Vim Quickly From WTF to OMG in no time

4. GNU Emacs

gnu emacs text editor
GNU Emacs text editor

GNU Emacs is undoubtedly one of the oldest and versatile text editors out there. In case you didn’t know, it was created by GNU Project founder Richard Stallman.

Emacs is cross-platform and has both command line and a graphical user interface. It is also very rich with various features and, most importantly, extensible.

Just as Vim, Emacs too comes with a steep learning curve. But once you master it, you can completely leverage its power. Emacs can handle just about any type of text file. The interface is customizable to suit your workflow. It supports macro recording and shortcuts as well.

The unique power of Emacs is that it can be transformed into something completely different from a text editor. There is a large collection of modules that can transform the application for use in completely different scenarios, like — calendar, news reader, word processor, etc. You can even play games in Emacs!

How to install it?

You should find it in your software center, or if you prefer using the terminal on Ubuntu-based distros, you can type in:

sudo apt install emacs

You can find more information on it on their official download page. Once you’re done installing, you need to type in a specific command to launch emacs in your terminal, which is:

emacs -nw

Basically, this command instructs not to include any window to launch the program but the terminal itself.

5. MCEDIT

mcedit text editor
mcedit text editor

Midnight Commander is a fairly popular command line file manager and mcedit is an internal file editor of GNU Midnight Commander. It’s possible that many of us forget about this text editor, which is embedded inside the midnight commander utility.

What this editor does, is open the files specified on the command line. The editor is based on the terminal version of cooledit – a standalone editor for X Window System.

How to install it?

mcedit comes with the Midnight Commander package. In Ubuntu, you can install it by:

sudo apt install mc

Once installed, you can open files by executing:

mcedit <file name>

For more information, you can check out their GitHub page.

6. Nano

nano text editor
Nano text editor

When it comes to simplicity, Nano is the one. Unlike Vim or Emacs, it is suitable for beginners to get used to quickly.

If you want to simply create & edit a text file, look no further.

The shortcuts available on Nano are displayed at the bottom of the user interface. It is minimal and perfectly suitable for editing system & configuration files. For those who don’t need advanced features from a command-line text editor, Nano is the perfect pick.

If interested, you can learn how to use Nano text editor in our beginner’s guide.

How to install it?

For the most part, Nano editor should come in pre-installed on Ubuntu-based distributions. If it isn’t there, you can simply visit the official download page to get the binaries for the distribution you want.

How to Use Nano Text Editor in Linux [With Cheat Sheet]
Though Nano is less complicated to use than Vim and Emacs, it doesn’t mean Nano cannot be overwhelming. Learn how to use the Nano text editor.

7. Tilde

tilde text editor
Tilde text editor

Tilde is a terminal-based text editor tailored for users who are normally used to GUI applications.

Unlike other options mentioned in this list — this may not be a power tool. But, for basic text editing operations, this is very easy to use. You do have some advanced functionality – but that’s not something to compare with Vim/Emacs.

If you wanted to try something easy-to-use and different, this is the one I’d recommend you to try.

How to install it?

For Ubuntu-based distros, you can simply type the following command in the terminal:

sudo apt install tilde

For information on other Linux distributions, you may refer to their GitHub page or the download page to explore more about it.

8. Micro

micro text editor
Micro text editor

Micro is an easy-to-use and highly customizable text editor. It also implements the universal copy/paste/save shortcuts (CTRL + C/V/S), which is rare in Linux terminal editors. Another cool offering from this text editor is its plugin system and internal command mode.

Though it’s not feature-rich like Vim or other mature text editors, it can easily replace tools like Nano for occasional file editing in the terminal.

How to install it?

Micro is available in the repositories of all major distributions. In Ubuntu, you can install it with:

sudo apt install micro

For other Linux systems, you can check out their GitHub page. We have an article on Micro text editor with a free cheat sheet for beginners if you are interested.

9. Helix

helix editor
Helix editor

Helix editor is a rust-based terminal text editor, which is both fast and efficient in resources. It uses Tree-Sitter for syntax highlighting, which helps boost the speed. The built-in language server support provides context-aware completion, diagnostics, and code actions.

Helix editor offers several powerful tools, that can make it work like other editors like Vim and Emacs. On their website, they call themselves, a post-modern text editor, if Neovim is the modern Vim, then Helix is post-modern.

For those who are interested, you can check out a dedicated Helix article

How to install it?

For Arch and its derivatives, there is a package available in the Community repository. Also, an AUR package is also available, which builds the master branch.

For other Linux distributions, you have to use Cargo, the Rust Package Manager.

You should be able to install Cargo using your distribution package manager Also, you need to make sure that Git is installed. On Ubuntu-based distributions, install both like this:

sudo apt install git cargo

Next, you should use the below commands one by one.

git clone https://github.com/helix-editor/helix
cd helix
cargo install --path helix-term

Helix also needs its runtime files so make sure to copy/symlink the runtime/ directory into the config directory. This location can be overridden via the HELIX_RUNTIME environment variable.

ln -s $PWD/runtime ~/.config/helix/runtime

Now you should add the installed bin directory to your PATH.

export PATH=$PATH:/home/team/.cargo/bin

You can check out their official page for more information.

Wrapping Up

If you are an experienced Linux user, you must have heard of most of the options mentioned in this list, if not all.

For most users, going with Nano, Vim or Emacs should be good enough. The seasoned terminal dwellers could experiment with the likes of Micro, Helix or some other terminal text editors.

That’s just my recommendation. And I would like to know yours. Which text editor do you prefer in the command line? Did you find a new, interesting one on this list? Share it in the comments.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

It's FOSS

Making You a Better Linux User

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.