Enter nano in response to a shell prompt and use nano's fine, self contained "help" feature
to learn all about nano. nano will start by drawing an empty editing buffer on your
screen, like so:
Once you see this screen, your keystrokes are no
longer going to be accumulated by the shell for
interpretation as commands. Instead, each keystroke you type will go to nano and all the "ordinary" keystrokes will show up in the window as text (unless you
hold down the "control" key
on your keyboard). Once you start nano and start typing, the window might look like
In nano's on-screen documentation, the ^ symbol
is used to mean "hold down the control
key while simultaneously typing the following key." So on the nano editing screens, above, you see at the bottom of the screen a bunch of
reminders in inverse video like ^X
Exit Holding down the control key and then pressing
key will cause nano to exit. (Pressing the 'x'
key without holding down the control key will just enter a text 'x'
into the text editing portion of the nano buffer window.) Note: In the
nano display of ^X
Exit , that's a capital X
after the ^caret. To me, that would indicate that you should hold
down both the control key and the shift key before depressing the 'x'
key. But the "shift" is unnecessary. I myself would have made
that nano display look like ^x
Exit , but nano doesn't I don't know why.
Anyway, the three most important nano control keys are:
which exits (quits) nano and takes you back to a Unix shell prompt.
(Note: nano is user friendly, unlike some other Unix programs.
If you've entered or altered text in nano, as I did in the second figure,
above, nano prompts you for a file name to save your entered text into before
which brings up the first of a series of on-line help screens, which, among
other things, explain what all the other control keys do in nano (Note:
Other programs may [usually do, in fact] interpret control keys differently
than nano does. Each Unix/Linux program is free to chose its own conventions.
- ^_ (That's the dash/underscore and the control key held down together). Compilers provide line numbers with their error messages; ^_ allows you to tell nano exactly what line you want to go to so you don't have to hunt around your file looking for where your errors are.
To start editing an already existing file with nano, just enter nano file_name. If no such file exists,
nano will create a new but empty file for you by that name and then start with an empty
editing window as shown in the first figure, above. But you can
also start nano with no file name whatsoever and it will wait until an appropriate time to
ask you what name you want to assign to the new file it will create for your text.
I think I've given you enough information here to get started, and nano is
simple enough and has a nice internal help system; there's also a quick
reference card (the pdf file there actually is for an older version of nano that was named pico, but the quick reference card is still correct).