Getting started with Nano

Nano, a clone of Pico, emulates the functionality of Pico. Pico is a simple full screen ASCII editor for UNIX systems developed at the University of Washington.

Although we will cover only the basics of the Nano editor, you are invited to use the online help to explore the other features of Nano on your own.  


The circumflex (^) denotes a CONTROL key press. Examples are shown in Courier typeface; user input is shown in boldface.

Starting Nano


To start Pico with a blank page, at the unix % prompt type:


To start Pico with an existing file, at the unix % prompt type:

    nano <filename>

You will either be presented with a blank page or the first page of text from your existing document as shown in Figure 1.


\f0\fs20 \cf2 \expnd0\expndtw0\kerning0
\outl0\strokewidth0 \strokec2 data list /1 id 1-3 sex 6 birthwt 7-12 (2)\
list cases from 1 to 2\
begin data\
123 0245311\
124 0167932\
125 1342597\
126 0189421\
end data\
select if id=123\
write outfile=new /1 id 1-3 sex 6 birthwt 7-12 (2)\

[ Read 24 lines ]
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text ^T To Spell

Figure 1.

Notice that the bottom of the screen shows the options available to you such as Get Help, Exit, and so forth. Also, note that the cursor (arrow) keys can be used to move around on the page and the backspace key will (if properly set up) erase characters. ^G will provide more information on the menu options.


Moving the Cursor

Assume we have either entered some text or started Nano with an existing document. If the termcap entry for your terminal supports the cursor keypad, you can move the cursor around a character or line at a time using the arrow keys. If you do not have arrow keys or UNIX does not support them on your terminal, you can use the following Control-Key sequences to move the cursor: 

    ^P   Previous
    ^B   Backward
    ^F   Forward
    ^N   Next Line

If you want to move greater distances, you can use the following Control-Key sequences:

    ^A   Move to the beginning of the current line.
    ^E   Move to the end of the current line.
    ^V   Move forward a page of text.
    ^Y   Move backward a page of text.

Deleting Text

To delete individual characters or lines of text, use the following:

    <BACKSPACE>   Delete the character left of the cursor position.
    ^D   Delete the character at the cursor position.
    ^K   Delete (kill) the entire line at the cursor position.

To undelete lines in which the ^K command was used:

    ^U   Undelete last deleted line[s] at the cursor position.

Input and Output

The following are helpful commands for reading in a file and outputting a file:

    ^R   Insert an external file at the current cursor position.
    ^O   Output the current buffer to a file and save it.

Other Useful Commands

These commands, although not totally necessary, may come in handy:

    ^W   Search for (where is) specific text., ignoring case.
    ^L   Refresh the display.
    ^J   Justify the text in the current paragraph.
    ^T   Invoke the spelling checker.
    ^C   Report the cursor position.
    ^G   Get online help.

Quitting Nano

When you are done editing and ready to leave Nano, do the following:

    ^X   Exit Nano with the option to save the current file.


Please rate the quality of this answer: Poor Fair Okay Good Excellent
Not the answer you were looking for? Try different keyword combinations and if you still can’t find your answer, please contact us.
Article ID: 1749
Created: Thu, 10 Aug 2017 9:01pm
Modified: Thu, 11 Apr 2019 9:49am