Skip to Content
Installation

Install micro

A text editor in the terminal where Ctrl and S actually save, for those times you need to change a line in a file on a server.

Last reviewed:

What micro is

A text editor that runs in the terminal and works the way you already expect a text editor to work. Ctrl and S saves. Ctrl and C copies. Ctrl and Z undoes. You can use the mouse.

That sounds trivial. It is not, because the two editors that usually come preinstalled on a Linux machine, vim and nano, do none of that. Vim is notorious for beginners not being able to get out of it again. micro is the answer to that problem.

You need it as soon as you are going to change a line in a configuration file on a server, because then there is no graphical editor to open. That is the whole area of use, and it is more than enough.

Windows

Open PowerShell. Do this by pressing the Windows key, typing PowerShell and pressing Enter. Then run:

winget install zyedidia.micro

Winget comes with Windows 11 and newer versions of Windows 10. If you use Chocolatey or Scoop instead, the commands are choco install micro and scoop install micro respectively. All three install the same programs.

Linux Mint

Open Terminal and run:

sudo apt-get install micro

The version in Mint's package catalog is sometimes a couple of steps behind. If you want the latest one, there is an installation file that fetches the right version for your computer:

curl https://getmic.ro | bash

It places the program in the folder you are in. Move it to a location in the system's path with sudo mv micro /usr/local/bin/, so you can start it wherever you are.

Start by typing micro and a file name, for example micro anteckningar.txt. If the file does not exist, it is created when you save.

Three things to do first

  1. Learn the four commands that cover almost everything: Ctrl and S saves, Ctrl and Q closes, Ctrl and Z undoes, Ctrl and F searches. They are already where you expect them to be.
  2. Press Ctrl and E. A command line opens at the bottom of the window. Type help and press Enter, and you get the whole list without searching online.
  3. Open a real configuration file and change something small, for example a compose file from one of the other guides. That is where you will actually use micro, and practicing on a real file goes faster than practicing on an empty one.

The most common trap

Opening a system file without sudo and finding out only when you try to save. Files that belong to the system are not owned by your user, and micro only tells you at the moment of saving, that is, after you have made all your changes.

The work is not lost, though. micro asks at the bottom of the window: Permission denied. Do you want to save this file using sudo? (y,n). If you answer y and type your password, the file is saved anyway. That is the right answer nine times out of ten, and it is worth knowing before it happens, because the question comes in English in the middle of a moment where you are quite sure everything has gone wrong.

It is still easier to start with sudo micro /sokvag/till/filen when the file is outside your own home folder. You recognize them by the path starting with /etc or /var instead of /home. Then the question never comes.

On Windows there is no equivalent, and micro says so outright: Permission denied. Save with sudo not supported on Windows. There, the way forward is to close the file, start PowerShell as administrator and open it again.

Cart

Loading