Nano Basics
Purpose
This guide was written to cover basic operations in nano, and is meant to be very concise. For more information about nano check out:
http://www.nano-editor.org
Opening and creating files
Opening and creating files is simple in nano, simply type:
# nano filename
Nano is a modeless editor so you can start typing immediately to insert text. If you are editing a configuration file like /etc/fstab use the -w switch, for example: # nano -w /etc/fstab
It is very, very important that you use the -w switch when opening a config file. Failure to do so may keep your system from booting or other bad things.
Cutting and pasting
To cut a single line line you use ^K. You simply hold down CTRL and k at the same time. The line dissapears. To paste it you simply move the cursor to where you want to paste and punch ^U (CTRL u) on your keyboard. BAM! The line reapears. Suppose you need to move a whole paragraph. To move multiple lines simply cut each line one at a time, and then paste. BAM! The whole paragraph appears wherever you want it.
If you need a little more fine grained control then you need to mark the text. Move the cursor to the beginning of the text you want to cut. Hit ^^ (that's ctrl ^ or ctrl 6). Now move your cursor to the end of the text you want to cut. The desired text should be highlighted now. If need to cancel your text marking simply hit ^^ again. Click ^K to cut the text. Use ^U to paste it. BAM! Now that's cooking.
Searching for text
Searching for a string is easy as long as you think "WhereIs" instead of "Search". Simple hit ^W (CTRL w) and type in your search string. Like I said, easy.
Wrap up
That is all! Thanks to kiyose and quazion from #gentoo. Again, for more information about nano check out:
http://www.nano-editor.org