Nano Editor

Introduction

Nano is a text editor for terminals.

Open and create files

Open or create new files, you can type the following command:

1
nano filename

This will open a new editor window and you can start editing the file. At the bottom of the window, the most basic command shortcuts that can be used with the nano editor are listed. ^ means Ctrl keys (e.g., ^X = Ctrl + X).

Search and replace

You can use Ctrl + w to search key words, it will match the first key word. Then you can use Alt + w to move to the next key word.

To search and replace, press Ctrl + \. Enter the search term and the text to be replaced. The editor will move to the first match and ask if you want to replace it. y or n will move to the next match. Pressing A will replace all matches.

Save and exit

To save changes made to a file, press Ctrl + o. If the file does not yet exist, it will be created immediately after saving.

To exit nano, press Ctrl + x. If there are unsaved changes, you will be asked if you want to save the changes (Y means save, N means not save).

To save a file, you must have write access to the file. To create a new file, you need to have write access to the directory where the file will be createde

----- End Thanks for reading-----