Creating or editing a file using ‘nano’
- Log into your server via SSH.
- Navigate to the directory location you want to create the file, or edit an existing file.
- Type in nano followed by the name of the file. For example, if you wish to create (or edit) a new file name index.html, run the following:
[server]$ nano index.html
- A new file opens named index.html:
- Start typing your data into the file.
- When you’re ready to save the file, hold down the Ctrl key and press the letter ‘O‘ (Ctrl + O).
- The bottom of the prompt asks you to confirm the name of the file, which is already set as ‘index.html’:
- Click the ‘Enter’ key on your keyboard to save.
- When finished, click Ctrl + X to close ‘nano’ and return to your shell.


