Basic Nano Text Editor Commands: A Beginner’s Guide

The Nano text editor is a powerful yet simple command-line tool for editing text files in Linux. Its intuitive interface makes it a great choice for beginners. In this guide, we’ll cover the most essential commands you need to navigate, edit, and manage text files effectively with Nano.

The Nano text editor provides an efficient and user-friendly interface for editing text files in Linux. It’s ideal for both beginners and advanced users due to its simplicity and extensive feature set.


Table of Contents

  1. Navigation Commands
  2. Editing and Manipulating Text
  3. Searching and Replacing
  4. File Management
  5. Viewing Information
  6. Advanced Navigation
  7. Spell Checking
  8. Text Selection
  9. Bonus Tips for Efficiency
  10. Summary Table of Commands

  • CTRL + A: Jump to the beginning of the current line.
  • CTRL + E: Jump to the end of the current line.
  • CTRL + Y: Scroll one page up.
  • CTRL + V: Scroll one page down.

Tip: These shortcuts save time when navigating through large files without using arrow keys.


  • CTRL + K: Cuts the entire line where the cursor is positioned and stores it in the cut buffer.
  • CTRL + U: Pastes the text from the cut buffer into the current position.
  • CTRL + J: Justifies the current paragraph (aligns text neatly).

  • CTRL + W: Search for a specific word or phrase in the text.
  • ALT + W: Repeat the last search to find the next occurrence.
  • CTRL + \: Replace a word or phrase with another. Nano also supports regular expressions for more advanced replacements.

File Management

  • CTRL + O: Save the current file. Nano will prompt you to confirm or modify the filename.
  • CTRL + R: Insert the contents of another file into the current file at the cursor position.
  • CTRL + X: Exit the editor. If there are unsaved changes, Nano will prompt you to save them before exiting.

Viewing Information

  • CTRL + C: Display the current cursor position (line, column, and character number).
  • CTRL + G: Open the help window, which lists all available Nano commands.

Advanced Navigation

  • CTRL + _ : Jump to a specific line and column number. This is helpful for editing code or troubleshooting errors in long files.

Spell Checking

  • CTRL + T: Run the spell checker (if installed). Use this feature to identify and correct spelling errors in your text.

Text Selection

  • ALT + A: Begin selecting text. Use arrow keys to highlight the desired section.
  • Combine with CTRL + K: Cut the selected text to the cut buffer for pasting elsewhere.

Bonus Tips for Efficiency

  • Case Sensitivity: By default, searches are case-sensitive. To perform a case-insensitive search, prepend your search term with (?i) (e.g., (?i)example).
  • Undo/Redo: While Nano does not have built-in undo/redo commands in all versions, some modern versions support ALT + U (undo) and ALT + E (redo).
  • Save Without Exiting: Use CTRL + O to save your changes and continue editing without leaving Nano.

Summary Table of Commands

CommandExplanation
CTRL + AJump to the beginning of the line.
CTRL + EJump to the end of the line.
CTRL + YScroll one page up.
CTRL + VScroll one page down.
CTRL + GOpen the help window.
CTRL + OSave the current file.
CTRL + WSearch for a word or phrase.
CTRL + KCut the current line to the cut buffer.
CTRL + UPaste from the cut buffer.
CTRL + JJustify the current paragraph.
CTRL + CShow the current cursor position.
CTRL + RInsert another file at the cursor position.
CTRL + XExit Nano.
CTRL + \Replace text or a regular expression.
CTRL + TInvoke the spell checker.
CTRL + _Jump to a specific line and column.
ALT + AStart selecting text (combine with other commands like CTRL + K).