Basic File Editing with Nano Text Editor

GNU Nano text editor is just one of many choices on Linux and Unix-like operating systems, but since it is the editor I use on my server, it will be the tutorial of choice today. It is easy to learn and use, though some may argue that some of the more complicated text editors, such as Vi or Vim, are more powerful. Nevertheless, Nano is more than enough for basic file editing and system configuration.

Edit a file:

$ nano filename

To make sure you preserve line breaks, you can edit with the -w option:

$ nano -w filename

From within the interface, you can navigate with the arrow keys up, down, left, and right. Enter creates a line break, and the space creates spaces, just as they would in a desktop text editor.

To find a keyword in a file, press CTRL+W

To move down an entire page, press CTRL+V

To move up an entire page, press CTRL+Y

When you are finished editing a file, press CTRL+X to exit. It will ask you if you want to save the file. Press Y and ENTER to save and exit.

That is all it takes to edit a file with Nano. GNU Nano is a free and open source alternative to the once popular text editor called Pico. For more information about Nano, visit the project website.