Nano Text Editor#

Here’s a very brief tutorial on using the Nano text editor.

Nano is a simple and user-friendly text editor for quick editing text files in the terminal. If you know other text editors such as vi or emacs, you are welcome to use them too.

Opening a File:#

To open a file with Nano, simply type nano followed by the filename from the command line in a terminal.

For example, if you type in a terminal:

nano filename.txt

you will open a nano window as shown in Figure 1.

Copy/paste website

Figure 1: Nano window

Basic Navigation:#

Use the arrow keys to navigate through the text.

  • Ctrl + y: Page Up

  • Ctrl + v: Page Down

Editing Text:#

To start editing, simply type. You can insert, delete, and modify text as needed.

Saving Changes:#

To save your changes, press Ctrl + o, confirm the filename, and press Enter.

Exiting Nano:#

To exit Nano, press Ctrl + x. If you have unsaved changes, Nano will prompt you to save them.

Search for text:#

To locate a specific text in Nano, press Ctrl + w. Do `Ctrl + c, to cancel the search and return to normal editing mode.

Other Useful Commands:#

  • Ctrl + g: Get help.

  • Ctrl + k: Cut (delete) a line.

  • Ctrl + u: Uncut (paste) the cut line.

  • Ctrl + c: Show cursor position.