If you aren’t using (or can’t use) the GUI, you have numerous text editors available to you. The most powerful of these are vi and emacs, which you’ll hear many people go on about. However, both these programs require a learning curve. For beginners who want to just edit the dang file and move on, I recommend nano, which offers a friendly, menu-driven interface.
To open a file in nano, type nano filename, such as nano file1. This action opens the file in the nano editor, as shown in Figure 11-1.
You can then edit or type in that file as much as you need to.
To save your file’s contents without closing it (so that you can keep working on it):
Press Ctrl+O to Write Out. A prompt appears toward the bottom of the screen, asking for the name of the file and offering the current name as the default option.
If you want to use the same name, press Enter. If you want to change the name, make your changes and then press Enter. The lower part of your screen now displays that it wrote (saved) a certain number of lines.
Get back to work!
To save your file’s contents and close it (because you’re done working on it for now) — or to close the file and not save the changes — do the following: