Skip to main content

Getting Started With Nano Editor

Learn all the essentials of editing text files in the Linux terminal with the beginner-friendly Nano editor.

Nano is perhaps one of the simplest terminal based text editor.

While it is still keyboard shortcut based, the shortcuts are simpler here when compared to Vim and Emacs.

Nano also displays appropriate shortcuts on the bottom all the time, making it even easier to use. You don't need to remember all the shortcuts.

Remember that in the keyboard shortcut suggestions, ^ means control and M means Alt.

So, if you see:

  • ^G: You press both Ctrl and G keys together
  • M-Q: You press both Alt and Q keys together
💡
When you feel lost, look at the bottom for hints. Or, you can press ^G (i.e. Ctrl+G) to open the help page.

Although Nano is not as complicated as Vi, Vim, or Emacs, there is still a learning curve involved. This is why I have organized some essential Nano tips in a proper order. This will teach you all the basics you need to start editing files in the Nano editor.

What will you learn?

You'll learn the following in this Nano course:

  • Open files for editing
  • Save and exit files
  • Move around the editor
  • Undo and redo actions
  • Cut, copy and paste in the editor
  • Search and replace text
  • Delete lines

I have also added an extra section with some additional tips to help you use Nano more effectively.

What do you need?

You need a Linux system with Nano installed on it. Most Linux distributions come with Nano preinstalled.

Verify it by checking Nano version

nano --version

If you see an output like "nano command not found", you need to install it first. You can use your distribution's package manager to install it.

With that set, let's how to use Nano to edit files.