Using Nano Text Editor

Nano is a simple text editor that is selected for the first year students to use in the CS Department. The commands of nano text editor are displayed at the bottom of the screen. When you type, the characters are immediately inserted into the text. You use the arrow, home, end, page up and page down keys to move around. All other editing commands are used by typing the control-key sequences.

Simply enter nano filename to call up nano editor.
If the file does not exist, it will be created. If the file does exist, it will be read into the edit buffer.

The following picture shows a nano call up screen.

From the commands displayed at the bottom of the screen, select ^G by pressing ctrl-g, to get help. You should see the following.

Press ctrl-v or page down to view more pages. Read the commands which are very useful to you when you edit your C++ program.

Keep using ctrl-v or page down to read all the commands.

When you are done press ctrl-x to exit the help page. Press ctrl-x again to exit the nano text editor. You should see the unix command line. It's time to practice.

Example of creating a file with nano

Here is an example of how to create a file called "header.txt".

Start by entering: nano header.txt

Entering the following lines.

        Student Number:
        Assignment Number:
        Program Creation Date:
        Purpose of the Program:

When you finish editing the file, be sure to save (ctrl-o, enter) and exit (ctrl-x).

Copyright: Department of Computer Science, University of Regina.