Throughout the labs, you will be asked to ssh into different servers and edit files on those servers. Once you log in, you will find several text editors available to you: Vim, Emacs and Nano. While Vim and Emacs are very powerful, they are also hard to use if you are unfamiliar with these editors. Nano is a much easier option. This guide provides some basic instructions on how to use Nano.

To edit a specific file, enter the following on the command prompt:

nano path/to/filename

For example, to edit the elasticsearch.yml configuration file in the elasticsearch-7.3.1/config directory, execute the following command:

nano elasticsearch-7.3.1/config/elasticsearch.yml

Your terminal window you will now show you the Nano user interface. At the top, you will see the filename of the file that you are editing. Just below that, the body of the file. And at the bottom of the terminal you will see two rows with common keyboard shortcuts:

nano01

For the keyboard shortcuts, the caret (^) symbol shown at the bottom of the terminal window indicates the Ctrl key on your keyboard. For example, to read the built-in help text you would hit Ctrl-G, and then to exit the help text you would hit Ctrl-X.

You can use the arrow keys on your keyboard to navigate the cursor to the position where you want to make changes to the file. You can also use the Ctrl-V or Ctrl-Y shortcuts to go the next or previous page.

If you wish to save the file, you can hit Ctrl-O. Nano will ask you to confirm the filename at the bottom of the terminal window. You can just hit Enter to keep the current filename.

Finally, if you are done editing the file, you can exit Nano by hitting Ctrl-X. If there are any unsaved changes to the file, Nano will ask you whether you wish to save the file first.


© Elasticsearch BV 2015-2019. All rights reserved. Decompiling, copying, publishing and/or distribution without written consent of Elasticsearch BV is strictly prohibited.