How to use nano editor – Beginners’ guide
In this article we will see how to use the very popular nano editor. This is just a very basic introduction for beginners.
First of all you have to login to SSH. If you don’t have nano installed you can do it by typing for CentOS:
yum install nano
And for Ubuntu:
sudo apt-get install nano
After this you are ready to use it. In order to edit a file, the command (for file.txt for example) is:
and then the GUI of the nano editor will appear with the contents of the file you want to edit. You can edit the text like any other text editor and some basic commands are:
- To save a file in nano: CTRL+O
- To exit nano: CTRL+X (if you haven’t saved the file it will ask you, with Y you save and with N you don’t)
- To search for a text CTRL+W
There are many more commands you can use, like copy/paste etc but this is just an introductory guide. For more information you can check the nano official website.