Introduction to Nano – The Text Editor

To open Nano, simply type nano followed by the name of the file you want to edit. If the file doesn’t exist, Nano will create a new one with that name.

nano filename.txt

Basic Navigation

Use the arrow keys to move the cursor around the text. Page up and page down keys move up and down a page at a time.

  • Use Ctrl + A moves to the beginning of the line.
  • Use Ctrl + E moves to the end of the line.
  • Use Ctrl + Y scrolls up one line.
  • Use Ctrl + V scrolls down one line.

Editing Text

Type directly into the editor to add or modify text. Use the backspace key to delete characters. To delete entire lines, use Ctrl + K to cut the line. Use Ctrl + U to paste the cut line.


Saving and Exiting

To save your changes, press Ctrl + O (WriteOut). You’ll be prompted to confirm the filename. To exit Nano, press Ctrl + X (Exit). If you haven’t saved your changes, Nano will prompt you to save before exiting.


Searching

Press Ctrl + W to search for text within the file. Type the word or phrase you want to search for and press Enter. Use Ctrl + W again to find the next occurrence.


Other Useful Commands

Use Ctrl + G displays the help menu with all available commands. Use Ctrl + C shows the current cursor position. Use Ctrl + \_ (underscore) enables or disables soft wrapping of long lines.


Customization

Nano can be customized by creating or modifying a configuration file called .nanorc in your home directory. You can adjust settings like syntax highlighting, key bindings, and more.

Last updated 01 Sep 2024, 10:22 CEST . history